Chewing international (unicode) filenames on windows?

Andrew Markebo flognat at flognat.myip.org
Tue Mar 19 02:33:36 EST 2002


Hello!

I am messing a bit with my bookmarks (gonna sync them between a bunch
of computers and browsers) and now comes the question.. How does
os.listdir in the windows-compiled python handle international
characters?

For me on my windows 2000 machine, to get them into UTF-8 format I do
something like:

for filename in os.listdir():
        utffilename=unicode(filename, "latin-1").encode("utf-8")

But do we know that it is latin-1? How would we handle chineese
characters? Someone said the filenames were unicoded, how do I
encode/decode the filename som I can get it into UTF-8??

        /Andy

p.s. standard windows compilation downloaded from THE site.
p.s.2 what is the status on win9x? Give it up or ;-)
-- 
 The eye of the beholder rests on the beauty!



More information about the Python-list mailing list