[Python-Dev] Support of UTF-16 and UTF-32 source encodings

Random832 random832 at fastmail.com
Sat Nov 14 20:25:57 EST 2015


Chris Angelico <rosuav at gmail.com> writes:
> Can the py.exe launcher handle a UTF-16 shebang? (I'm pretty sure Unix
> program loaders won't.)

A lot of them can't handle UTF-8 with a BOM, either.

> That alone might be a reason for strongly encouraging ASCII-compat
> encodings.

A "python" or "python3" or "env" executable in any particular location
such as /usr/bin isn't technically guaranteed, either, it's just relied
on as a "works 99% of the time" thing. There's a reasonable case to be
made that transforming files in such a way as they get launched by
python (which may require an encoding change to an ASCII-compatible
encoding, or a wrapper script, or the python -x hack) is the
responsibility of platform-specific installer code.



More information about the Python-Dev mailing list