STINNER Victor <vstin...@redhat.com> added the comment:
About the ANSI code page, Lib/encodings/__init__.py calls _winapi.GetACP() to avoid relying on locale.getpreferredencoding() which lies when UTF-8 Mode is enabled: import _winapi ansi_code_page = "cp%s" % _winapi.GetACP() if encoding == ansi_code_page: import encodings.mbcs return encodings.mbcs.getregentry() INADA-san: > So I don't think it is lie. It is just "what encoding name we should choose > when GetACP() returned 65001.". > With your PR 13230, cp65001 is truly utf-8. So returning "utf-8" seems right > behavior. Well, feel free to propose a PR. I have no strong opinion on this level of detail :-) ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue36778> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com