Message345454
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 |
|
Date |
User |
Action |
Args |
2021-02-23 13:47:44 | eryksun | unlink | issue37198 messages |
2019-06-13 03:46:02 | eryksun | set | recipients:
+ eryksun, lemburg, SilentGhost, mangrisano, hodai goldman |
2019-06-13 03:46:02 | eryksun | set | messageid: <1560397562.8.0.376189634106.issue37198@roundup.psfhosted.org> |
2019-06-13 03:46:02 | eryksun | link | issue37198 messages |
2019-06-13 03:46:02 | eryksun | create | |
|