☺:
>>> bytes('☺','ibm437')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.3/encodings/cp437.py", line 12, in encode
return codecs.charmap_encode(input,errors,encoding_map)
UnicodeEncodeError: 'charmap' codec can't encode character '\u263a' in position 0: character maps to <undefined>
動作するéとは対照的に:
>>> bytes('é','ibm437')
b'\x82'
☺が私を連れ戻すことを期待していますb'\x01'
。どうすればこれを実現できますか?