Locale Identifiers (Compact 2013)
3/28/2014
A locale identifier is a standard international numeric abbreviation, that can uniquely identify one of the installed system-defined locales.
LCID Format
Each locale has a unique locale identifier (LCID), which is a 32-bit value that consists of a language identifier and a sort identifier. The LCID is constructed using the MAKELCID macro. The following illustration shows the format of the bits in an LCID.
+-------------+---------+-------------------------+
| Reserved | Sort ID | Language ID |
+-------------+---------+-------------------------+
31 20 19 16 15 0 bit
Locale information is always stored and manipulated as a null-terminated string. No binary data is allowed; any numeric values must be specified as text. Each type of information has a particular format. In addition, several of the types are linked together, so that changing one changes the value of the other as well.
Although a specified locale identifier may be supported, it is not available for use by an application unless it is also installed.
The following locale identifiers are predefined:
- LOCALE_SYSTEM_DEFAULT, which identifies the system default locale.
- LOCALE_USER_DEFAULT, which identifies the locale of the current user.
- LOCALE_NEUTRAL, which identifies the default language-neutral locale.
The LOCALE_NEUTRAL identifier is the same as LOCALE_USER_DEFAULT. An application can retrieve the current locale identifiers by using the GetSystemDefaultLCID and GetUserDefaultLCID functions.
Language ID Format
A language identifier is a standard international numeric abbreviation for a country/region. Each language has a unique language identifier (LANGID), which is a 16-bit value that consists of a primary language identifier and a secondary language identifier. The LANGID is constructed using the MAKELANGID macro. The following illustration shows the format of the bits in a LANGID.
+-------------------------+-------------------------+
| Secondary Language ID | Primary Language ID |
+-------------------------+-------------------------+
15 10 9 0 bit
The following language identifiers are predefined:
- LANG_SYSTEM_DEFAULT, which identifies the system default language.
- LANG_USER_DEFAULT, which identifies the language of the current user.
Requirements
Header |
winnls.h |
Library |
Coreloc.lib |
See Also
Reference
National/Regional Language Support (NLS) Constants
Language Identifiers