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



