Python 3 encoding question: Read a filename from stdin, subsequently open that filename

Yingjie Lan lanyjie at yahoo.com
Tue Nov 30 00:52:07 EST 2010


--- On Tue, 11/30/10, Dan Stromberg <drsalists at gmail.com> wrote:
> In Python 3, I'm finding that I have encoding issues with
> characters
> with their high bit set.  Things are fine with strictly
> ASCII
> filenames.  With high-bit-set characters, even if I
> change stdin's
> encoding with:

Co-ask. I have also had problems with file names in
Chinese characters with Python 3. I unzipped the 
turtle demo files into the desktop folder (of
course, the word 'desktop' is in Chinese, it is
a windows XP system, localization is Chinese), then
all in a sudden some of the demos won't work
anymore. But if I move it to a folder whose 
path contains only english characters, everything
comes back to normal.

Another related issue on the same platform is this: 
if you have your source file in the chinese 'desktop'
folder, and when you run the code and got some 
exceptions, the path information printed out
by the tracer wrongly encoded the chinese name 
for 'desktop'.

Yingjie



      



More information about the Python-list mailing list