[Python-Dev] Removal of Win32 ANSI API

"Martin v. Löwis" martin at v.loewis.de
Fri Nov 12 09:51:19 CET 2010


> Additionally:
> 
> d) Over a socket (like the HTTP protocol) -> Bytes.

Sure. However, you can't really expect that the bytes you receive
over the socket are a meaningful filename on your local Windows
installation. So it would be a bug in the application to not decode
the bytes that you receive before using them as a file name.
In a well-specified network protocol, you would know the encoding of
the bytes; IETF recommends to use UTF-8 for all new protocols. Using
an UTF-8 string as a filename on Windows will create mojibake.

Regards,
Martin


More information about the Python-Dev mailing list