On 1/26/21, Eryk Sun <eryk...@gmail.com> wrote:
>
> The process active code page for GetACP() and GetOEMCP() is changed to
> UTF-8 (65001). The C runtime also overrides the user locale to UTF-8
> if GetACP() returns UTF-8, i.e. setlocale(LC_CTYPE, "") will return
> "utf8" as the encoding.

One concern is what to do for the special "ansi" and "oem" encodings.
If scripts rely on them for IPC, such as with subprocess.Popen(), then
it could be frustrating if they're just synonyms for UTF-8 (code page
65001). I've tested that it's possible for Python to peg "ansi" and
"oem" to the system ANSI and OEM code pages via GetLocaleInfoEx() with
LOCALE_NAME_SYSTEM_DEFAULT and the LCType constants
LOCALE_IDEFAULTANSICODEPAGE and LOCALE_IDEFAULTCODEPAGE (OEM). But
then they're no longer accurate within the current process, for which
ANSI and OEM are UTF-8.
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/5RCA3LVRBWVAHGDRGMR5RVAGP647NGDJ/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to