DownlevelLocaleNameToLCID function

Converts a locale name to a locale identifier that can be used to get information from the operating system.

Note

This function is used only by applications that run on pre-Windows Vista operating systems. Its use requires a download package. Applications that only run on Windows Vista and later should call LocaleNameToLCID to retrieve a locale identifier.

 

Syntax

LCID DownlevelLocaleNameToLCID(
  _In_ LPWSTR lpName,
  _In_ DWORD  dwFlags
);

Parameters

lpName [in]

Pointer to a null-terminated string representing a locale name.

dwFlags [in]

Flags specifying the type of name. The default is DOWNLEVEL_LOCALE_NAME.

Return value

Returns the locale identifier that corresponds to the locale name if successful.

The function returns 0 if it does not succeed. To get extended error information, the application can call GetLastError, which can return one of the following error codes:

  • ERROR_INVALID_FLAGS. The values supplied for flags were not valid.
  • ERROR_INVALID_PARAMETER. Any of the parameter values were invalid.

Remarks

Note

This function does not support neutral locales. The equivalent LocaleNameToLCID function supports custom locales, but only for Windows Vista and later.

 

The required header file and DLL are part of the "Microsoft NLS Downlevel Data Mapping APIs" download, available at the Microsoft Download Center.

Requirements

Minimum supported client
Windows XP [desktop apps only]
Minimum supported server
Windows Server 2003 [desktop apps only]
Redistributable
Microsoft NLS Downlevel Data Mapping APIs onWindows XP with SP2 and laterorWindows Vista
Header
Nlsdl.h
DLL
NlsMap.dll

See also

National Language Support

National Language Support Functions

Mapping Locale Data

LocaleNameToLCID