Skip to content
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

OS.get_locale() fixed in windows && _OS::get_standardized_locale() implemented #37246

Closed

Conversation

ThakeeNathees
Copy link
Contributor

@ThakeeNathees ThakeeNathees commented Mar 23, 2020

Fix: #37203, #37207
Authored : @ippan
Reference: Microsoft Docs, winnt.h

+-------------------------+-------------------------+
|     SubLanguage ID      |   Primary Language ID   |
+-------------------------+-------------------------+
15                    10  9                         0   bit

sample case 1033 : "en-US"
1033 = 0b0000010000001001
0-9 bits : 0b0000001001 = 9 => #define LANG_ENGLISH 0x09 (winnt.h)
10-15 bits : 0b000001 = 1 => #define SUBLANG_ENGLISH_US 0x01 // English (USA)

core/bind/core_bind.cpp Outdated Show resolved Hide resolved
@Calinou Calinou added this to the 4.0 milestone Mar 23, 2020
@ThakeeNathees ThakeeNathees force-pushed the OS.get_locale-fixed branch 3 times, most recently from d39d5e6 to 4b5e3a7 Compare March 23, 2020 13:00
@ThakeeNathees ThakeeNathees changed the title OS.get_locale() fixed in windows && '_' replaced with '-' OS.get_locale() fixed in windows && _OS::get_standardized_locale() implemented Mar 23, 2020
core/bind/core_bind.cpp Outdated Show resolved Hide resolved
@ThakeeNathees
Copy link
Contributor Author

I haven't change the documentation of OS.get_locale, @Calinou already have a pr for that (#37207) it may need a little change about os dependency.

@akien-mga
Copy link
Member

Superseded by #40708. Thanks for the contribution nevertheless!

@akien-mga akien-mga closed this Dec 10, 2020
@ThakeeNathees ThakeeNathees deleted the OS.get_locale-fixed branch December 10, 2020 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OS.get_locale in Windows does not match sublang
4 participants