Chewing international (unicode) filenames on windows?
Mark Hammond
mhammond at skippinet.com.au
Tue Mar 19 03:29:45 EST 2002
Andrew Markebo wrote:
> 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")
utffilename=unicode(filename, "mbcs").encode("utf-8")
should work.
> 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)
Mark.
More information about the Python-list
mailing list