Author eryksun
Recipients SilentGhost, eryksun, hodai goldman, lemburg, mangrisano
Date 2019-06-13.03:46:02
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1560397562.8.0.376189634106.issue37198@roundup.psfhosted.org>
In-reply-to
Content
Windows prefers locale names based on RFC 4646 language tags, which use a hyphen instead of an underscore (e.g. "en-UK"). This name format doesn't include an encoding. The C runtime (not the Windows API) makes one exception to support ".utf8" and ".utf-8" (e.g. "en-UK.utf8"). If UTF-8 is not specified, setlocale implicitly uses the ANSI codepage of the given locale (which is not to be confused with the ANSI codepage of the system locale).

As noted in this issue, _parse_localename currently fails if there's no encoding. hodai's PR 14027 addresses this case by looking for underscore in the name. In Windows, it should also look for hyphen. Also, instead of using None for the encoding in this case, in Windows we can look it up via ___lc_codepage_func [1]. This could be added as _locale._lc_codepage_func.

[1] https://docs.microsoft.com/en-us/cpp/c-runtime-library/lc-codepage-func?view=vs-2019
History
Date User Action Args
2021-02-23 13:47:44eryksununlinkissue37198 messages
2019-06-13 03:46:02eryksunsetrecipients: + eryksun, lemburg, SilentGhost, mangrisano, hodai goldman
2019-06-13 03:46:02eryksunsetmessageid: <1560397562.8.0.376189634106.issue37198@roundup.psfhosted.org>
2019-06-13 03:46:02eryksunlinkissue37198 messages
2019-06-13 03:46:02eryksuncreate