Click to Rate and Give Feedback
MSDN
MSDN Library
User Interface
 Locale Identifiers
International Features
Locale Identifiers

Each locale has a unique identifier, a 32-bit value that consists of a language identifier and a sort order identifier. The locale identifier is a standard international numeric abbreviation and has the components necessary to uniquely identify one of the installed operating system-defined locales. For details of locale identifiers, see Locale Identifier Constants and Strings.

The following illustration shows the format of the bits in a locale identifier.

+-------------+---------+-------------------------+
|   Reserved  | Sort ID |      Language ID        |
+-------------+---------+-------------------------+
31         20 19     16 15                      0   bit

Your application can construct a locale identifier using the MAKELCID macro. Alternatively it can use one of the predefined identifiers listed below..

  • LOCALE_INVARIANT
  • LOCALE_SYSTEM_DEFAULT
  • LOCALE_USER_DEFAULT

Windows Vista and later: The following custom locale identifiers are also supported.

  • LOCALE_CUSTOM_DEFAULT
  • LOCALE_CUSTOM_UI_DEFAULT
  • LOCALE_CUSTOM_UNSPECIFIED

An application can retrieve the current locale identifiers by using the GetSystemDefaultLCID and GetUserDefaultLCID functions. Each thread can set and retrieve its own locale with SetThreadLocale and GetThreadLocale.

Related Topics

Locales and Languages, Locale Names

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Locale identifiers don't work completely      Shawn Steele - MSFT   |   Edit   |  

LCIDs don't solve all cases. There are some strange overlaps and seperations in their assignments. In addition custom locales all have the same langid, sublangid, etc. so LCIDs and their derived parts are pretty useless for describing locales accurately. en-FJ, fj-FJ and klingon would all have the same LCID/langid/sublangid.

Use locale names (en-US, etc) instead!.

Tags What's this?: pt-br (x) Add a tag
Flag as ContentBug
Processing
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker