Chewing international (unicode) filenames on windows?

Andrew Markebo flognat at flognat.myip.org
Tue Mar 19 04:15:11 EST 2002


| > 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")
| 
|           utffilename=unicode(filename, "mbcs").encode("utf-8")

Hello!

So do I get it right now, reading it as mbcs ("Multibyte-character")
will read all ntfs filenames correctly (as unicode defines it) into a
unicode string?

| > p.s.2 what is the status on win9x? Give it up or ;-)
| 
| I *think* it still works when accessing a Unicode aware file system
| (ie, network)

What I want is to read a local file-name on a win9x fat/fat32 disk and
be able to convert it into unicode.. And the other way around.

I will probably add a if windows9x do that, else if win2k do
this.. ;-) Hmm how do I determine windows-version?

        /Andy

-- 
 The eye of the beholder rests on the beauty!



More information about the Python-list mailing list