[Python-Dev] PEP 383 update: utf8b is now the error handler

"Martin v. Löwis" martin at v.loewis.de
Wed May 6 09:36:01 CEST 2009


Stephen J. Turnbull wrote:
> "Martin v. Löwis" writes:
>  > >     It occurs to me that the PEP maybe should say that it is an error
>  > >     to have your POSIX locale set to UTF-16 or something like that.
>  > 
>  > No. It is *impossible* to have UTF-16 as the locale character set,
>  > not an error. Your statement is like saying "it is an error to
>  > breathe in the vacuum".
> 
> I realize this is not useful, so maybe you don't need to mention it.
> However, it certainly is possible to set LANG with an absurd, or
> merely dangerous, encoding.

How so? The C library will filter it out.

>  > In any case, the discussion says
>  > 
>  > # Encodings that are not compatible with ASCII are not supported by
>  > # this specification; bytes in the ASCII range that fail to decode
>  > # will cause an exception. It is widely agreed that such encodings
>  > # should not be used as locale charsets.
> 
> Which is your excuse for not supporting Shift JIS fully.  It doesn't
> stop people from setting LC_ALL=ja_JP.shift_jis, 

Well, it *does* stop them from doing so if their systems don't support
the locale setting.

In any case, if they do this, PEP 383 will not support them.

> or using Shift JIS as the default encoding for certain media.

I fail to see how this could ever matter. If, by "media", you mean
things like removable disks, and the file name encoding used on them,
it's fairly irrelevant for the PEP, since Python won't start using
Shift JIS as its file system encoding just because that's the encoding
used on the disk.

Regards,
Martin



More information about the Python-Dev mailing list