On 3/17/2021 6:08 PM, Stefan Ring wrote:
A somewhat radical idea carrying this to the extreme would be to use
UTF-16 (LE) on Windows. After all, this _is_ the native file system
encoding, and Notepad will happily read and write it.

I'm not opposed to detecting a BOM by default (when no other encoding is specified), but that won't help most UTF-8 files which these days come with no marker at all.

I wouldn't change the default file encoding for writing though (except to unmarked UTF-8, and only with the compatibility approach Inada is working on). Everyone has basically come around to the idea that UTF-8 is the only needed encoding, and I'm sure if it had existed when Windows decided to support a universal character set, it would have been chosen. But with what we have now, UTF-16-LE is not a good choice for anything apart from compatibility with Windows.

Cheers,
Steve

_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/LTEJSNOH6EHESXSMXSW352JFG2SF7ZMX/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to