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

Stephen J. Turnbull stephen at xemacs.org
Wed May 6 07:10:41 CEST 2009


"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.

 > 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, or using Shift JIS as
the default encoding for certain media.



More information about the Python-Dev mailing list