[Python-Dev] Unicode strings as filenames

Martin v. Loewis martin@v.loewis.de
Fri, 4 Jan 2002 02:07:04 +0100


>    The system provided scripting languages support wide character file
> names. 

Please understand that Python also supports wide character file
names. It just doesn't allow all the possible values that the system
would allow.

> For Each f1 in fso.GetFolder("C:\").Files

That, of course, is another important difference: Here you get the
directory contents as wide strings. Changing os.listdir to return
Unicode objects would be possible, but would likely introduce a number
of incompatibilities. Your script (e.g. the Python variant) is
prepared that .Files returns Unicode objects. Making the same change
in Python on all functions that return file names (i.e. listdir, glob,
etc) is difficult - most likely, you'll have to make the return type
a choice of the application.

Regards,
Martin