[Python-Dev] Re: PEP 277: Unicode file name support for Windows NT, was PEP-time ? ...

Neil Hodgson nhodgson@bigpond.net.au
Wed, 16 Jan 2002 09:09:44 +1100


Martin v. Loewis:
> >    OK, PEP 277 is now available from:
> > http://python.sourceforge.net/peps/pep-0277.html
>
> Looks very good to me, except that the listdir approach (unicode in,
> unicode out) should apply uniformly to all platforms; I'll provide an
> add-on patch to your implementation once the PEP is approved.

   Won't this lead to a less useful result as Py_FileSystemDefaultEncoding
will be NULL on, for example, Linux, so if there are names containing
non-ASCII characters then it will either raise an exception or stick '?'s in
the names. So it would be better to use narrow strings there as that will
pass through all file names.

   You have probably already realised, but Windows 9x will also need a
Unicode preserving listdir but it will have to encode using mbcs.

   Neil