[Tutor] Encoding in non ASCII

Harm Kirchhoff harm.kirchhoff at web.de
Sun Apr 18 21:04:36 EDT 2004


Probably many will not be able to read all of the following code:

I am running Python on a Japanese Windows 2000 machine, whenever I want 
to open a file path that contains Japanese characters (such as the 
Desktop, which is spelled in Japanese, python fails.)

I have been looking for code examples how to choose the best encoding 
but could not find enlightment. Does anybody (may be a Japanese 
colleague, have a hint ?)

 >>> f=open("C:\Documents and Settings\Kirchhoff\??????\test.txt",'r')
Traceback (most recent call last):
   File "<pyshell#7>", line 1, in ?
     f=open("C:\Documents and Settings\Kirchhoff\??????\test.txt",'r')
IOError: [Errno 2] No such file or directory: 'C:\\Documents and 
Settings\\Kirchhoff\\\x83f\x83X\x83N\x83g\x83b\x83v\test.txt'
 >>>





More information about the Tutor mailing list