Получение python для печати в UTF8 в Windows XP с помощью консоли

Я хотел бы настроить свою консоль в 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()

Итак, по умолчанию я нахожусь в 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
>>> sys.stdout.encoding
'cp65001'
>>> print u'é'
C:\Documents and Settings\Philippe>

Похоже, печать в UTF8 сейчас вызывает сбой python ...

11
задан Philippe F 10 August 2011 в 16:34
поделиться