-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
locale.windows_locale
: Incorrect Windows locale for Cambodian
#123853
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
@rruuaanng - how did you fix it? how did you test it? |
@rruuaanng If this issue is valid (should be confirmed from |
I checked the results of the
|
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
locale.getdefaultlocale()
: Incorrect Windows locale for Cambodian
I changed my locale to Khmer. Python gives me: >>> locale.getdefaultlocale()
('km_KH', 'cp1252') The >>> import _locale; _locale._getdefaultlocale()
('km_KH', 'cp1252') So the string The >>> locale.setlocale(locale.LC_CTYPE, '')
'Khmer_Cambodia.1252' |
@vstinner - I'm not sure I understand the point you are trying to make in regards to deprecation. We use |
Ah. This dictionary is not documented. How do you use it? Do you have an example? |
I spent half a day today updating |
This means that no changes to the code are required, right? |
In getdefaultlocale func, Yes! I found this: import warnings
warnings._deprecated(
"locale.getdefaultlocale",
"{name!r} is deprecated and slated for removal in Python {remove}. "
"Use setlocale(), getencoding() and getlocale() instead.",
remove=(3, 15)) |
Does this mean it's not part of the supported API? Will it be removed when |
It means that you're in the gray area, maybe it's supposed, maybe not :-)
Good question. I didn't know that @serhiy-storchaka: Maybe it's worth it to update |
locale.getdefaultlocale()
: Incorrect Windows locale for Cambodianlocale.windows_locale
: Incorrect Windows locale for Cambodian
There is a problem -- name of some Windows locales is incompatible with The current table ignores modifiers, and |
Update the table of Windows language code identifiers (LCIDs) to protocol version 16.0 (4/23/2024).
Update the table of Windows language code identifiers (LCIDs) to protocol version 16.0 (4/23/2024).
Uh oh!
There was an error while loading. Please reload this page.
Bug report
Bug description:
According to the Windows spec, the locale identifier for Cambodian (
0x0453/1107
) should be "km-KH"Sources:
Currently
locale.windows_locale[1107] == "kh_KH"
incorrectly.https://github.com/python/cpython/blob/3.12/Lib/locale.py#L1596
It is possible this mistake is from an older version of the protocol, but using the MS reference, the current mapping in Windows has been the case since the earliest recorded spec from
8/8/2013
.If this issue is accepted I am happy to make a small PR to adjust this value.
CPython versions tested on:
3.11, 3.12, 3.13, CPython main branch
Operating systems tested on:
Windows
Linked PRs
The text was updated successfully, but these errors were encountered: