Python has a unicode
built-in function that converts an byte stream to unicode string.
I just hope I can query all the available encoding on my system. But how to.
The reason for this question is: Some one using MAC OS X sent me an email with content-encoding 'iso-2022-cn', and I find that Python 2.7 on Windows 7 does not recognize that encoding.
>>> print unicode(bs2022, 'iso-2022-cn')
Traceback (most recent call last):
File "<pyshell#97>", line 1, in <module>
print unicode(bs2022, 'iso-2022-cn')
LookupError: unknown encoding: iso-2022-cn
So I'd like to find out whether Python uses a different name for 'iso-2022-cn' by looking at all encoding he can support.