How is this possible? Is it a bug? (Same behavior in Python 2.7.12 and Python 3.5.1.)
In [1]: yen = u'\u00A5'
In [2]: print(yen)
¥
In [3]: yen_after_encoding_decoding = yen.encode('shift-jis').decode('shift-jis')
In [4]: print(yen_after_encoding_decoding)
\
In [5]: yen
Out[5]: '¥'
In [6]: yen_after_encoding_decoding
Out[6]: '\\'
In [7]:
The shift-jis encoding for yen is the same as the ASCII encoding for backslash, so presumably that's related. But still weird!