Unicode不是编码。您编码为字节字符串,然后解码为Unicode:
>>> '\x89'.decode('cp437')
u'\xeb'
>>> u'\xeb'.encode('cp437')
'\x89'
>>> u'\xeb'.encode('utf8')
'\xc3\xab'
Windows终端将旧版代码页用于DOS。对于美国Windows,它是:
>>> import sys
>>> sys.stdout.encoding
'cp437'
Windows应用程序使用Windows代码页。Python的IDLE将显示Windows编码:
>>> import sys
>>> sys.stdout.encoding
'cp1252'
您的结果可能会有所不同。