[Python-Dev] Unicode and the Windows file system.

Mark Hammond MarkH@ActiveState.com
Mon, 19 Mar 2001 21:34:46 +1100


> Hmm... the problem with MBCS is that it is not one encoding,
> but can be many things.

Yeah, but I think specifically with filenames this is OK.  We would be
translating from Unicode objects using MBCS in the knowledge that somewhere
in the Win32 maze they will be converted back to Unicode, using MBCS, to
access the Unicode based filesystem.

At the moment, you just get an exception - the dreaded "ASCII encoding
error: ordinal not in range(128)" :)

I don't see the harm - we are making no assumptions about the user's data,
just about the platform.  Note that I never want to assume a string object
is in a particular encoding - just assume that the CRTL file functions can
handle a particular encoding for their "filename" parameter.  I don't want
to handle Unicode objects in any "data" params, just the "filename".

Mark.