Platform SDK: International Features |
The GetLocaleInfo function retrieves information about a locale.
int GetLocaleInfo( LCID Locale, // locale identifier LCTYPE LCType, // information type LPTSTR lpLCData, // information buffer int cchData // size of buffer );
Value | Meaning |
---|---|
LOCALE_SYSTEM_DEFAULT | Default system locale. |
LOCALE_USER_DEFAULT | Default user locale. |
If LOCALE_NOUSEROVERRIDE is combined with another value, the function bypasses user overrides, and returns the system default value for the requested LCID. The information is retrieved from the locale database, even if the LCID is the current one and the user has changed some of the values in Control Panel. If this flag is not specified, the values in Win.ini take precedence over the database settings when getting values for the current system default locale.
If the function succeeds, the return value is the number of TCHARs written to the destination buffer. If the cchData parameter is zero, the return value is the number of bytes or characters required to hold the locale information.
If the function fails, the return value is zero. To get extended error information, call GetLastError. GetLastError may return one of the following error codes:
The GetLocaleInfo function always retrieves information in text format. If the information is a numeric value, the function converts the number to text using decimal notation.
The LOCALE_FONTSIGNATURE parameter will return a non-NULL terminated string. In all other cases, the string is NULL terminated.
The ANSI string returned by the ANSI version of this function is translated from Unicode to ANSI based on the default ANSI code page for the LCID. However, if LOCALE_USE_CP_ACP is specified, the translation is based on the system default–ANSI code page.
Windows 2000: The ANSI version of this function will fail if it is used with a Unicode-only LCID. See Language Identifiers.
Windows NT/2000: Requires Windows NT 3.1 or later.
Windows 95/98: Requires Windows 95 or later.
Header: Declared in Winnls.h; include Windows.h.
Library: Use Kernel32.lib.
Unicode: Implemented as Unicode and ANSI versions on Windows NT/2000.
National Language Support Overview, National Language Support Functions, GetStringTypeA, GetStringTypeEx, GetStringTypeW, GetSystemDefaultLCID, GetUserDefaultLCID, LCTYPE Constants, SetLocaleInfo, MAKELCID