(Fucking) Unicode: console print statement and PythonWin: replacement for off-table chars HOWTO?

Neil Hodgson nyamatongwe+thunder at gmail.com
Tue Jan 10 16:23:51 EST 2006


Robert:

> u'sytest3\\\u041f\u043e\u0448\u0443\u043a.txt'
> 
> u'\u043a' is cyrillic:  к
> 
> no matter, I guess no (small) system can know all unicode ranges in use
> wordwide. The real problem is: to get a smoot, smart an tolerant setup
> by default - not a mixup of 4 codecs and (most bothersome) intolerant
> exception-breaks on simple tty-/win-outputs.

    PythonWin did have some Unicode support but I think Mark Hammond was 
discouraged by bugs. In pythonwin/__init__.py there is a setting 
is_platform_unicode = 0 with a commented out real test for Unicode on 
the next line. Change this to 1 and restart and you may see

 >>> x = u'sytest3\\\u041f\u043e\u0448\u0443\u043a.txt'
 >>> print x
sytest3\Пошук.txt
 >>>

    This is dependent on using fonts that contain the required 
characters. Tested on Windows XP SP2 with PythonWin build 204.

    Neil



More information about the Python-list mailing list