[Python-3000] [Python-Dev] Filename as byte string in python 2.6 or 3.0?

James Y Knight foom at fuhm.net
Tue Sep 30 19:47:06 CEST 2008


On Sep 30, 2008, at 1:37 PM, Marcin 'Qrczak' Kowalczyk wrote:
> I've experimentally implemented (not for Python) a different escaping
> scheme with a similar goal as UTF-8b: undecodable bytes are prefixed
> with U+0000 instead of being converted to unpaired surrogates, and
> '\x00' decodes as U+0000 U+0000.
>
> Glib provides some functions to convert filenames for display, in a
> way which is not necessarily reversible (includes some hex escapes in
> ASCII).

This sounds quite promising: 0 is an invalid character in the  
filesystem API, in the environment, and in command lines, yet not in a  
unicode string. Good thinking!

James


More information about the Python-3000 mailing list