相关疑难解决方法(0)

让python在Windows XP上使用控制台以UTF8进行打印

我想在Windows XP上配置我的控制台以支持UTF8并让python检测并使用它.

到目前为止,我的尝试:

C:\Documents and Settings\Philippe>C:\Python25\python.exe
Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> print u'é'
é
>>> import sys
>>> sys.stdout.encoding
'cp437'
>>> quit()
Run Code Online (Sandbox Code Playgroud)

所以,默认情况下我在cp437并且python检测到就好了.

C:\Documents and Settings\Philippe>chcp 65001
Active code page: 65001

C:\Documents and Settings\Philippe>python
Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> …
Run Code Online (Sandbox Code Playgroud)

python windows unicode windows-xp utf-8

11
推荐指数
1
解决办法
6619
查看次数

标签 统计

python ×1

unicode ×1

utf-8 ×1

windows ×1

windows-xp ×1