IsValidLocaleName function

Determines if the specified locale name is valid for a locale that is installed or supported on the operating system.

Note  An application running only on Windows Vista and later should call this function in preference to IsValidLocale to determine the validity of a supplemental locale.

 

Syntax

BOOL IsValidLocaleName(
  LPCWSTR lpLocaleName
);

Parameters

lpLocaleName

Pointer to the locale name to validate.

Return Value

Returns a nonzero value if the locale name is valid, or returns 0 for an invalid name.

Remarks

On Windows Vista and later, all supported locales should be installed on all operating systems.

This function can handle the name of a custom locale. Data is not guaranteed to be the same from computer to computer or between runs of an application. If your application must persist or transmit data, see Using Persistent Locale Data.

Beginning in Windows 8: If your app passes language tags to this function from the Windows.Globalization namespace, it must first convert the tags by calling ResolveLocaleName.

Examples

An example showing the use of this function can be found in NLS: Name-based APIs Sample.

Requirements

   
Minimum supported client Windows Vista [desktop apps | UWP apps]
Minimum supported server Windows Server 2008 [desktop apps | UWP apps]
Target Platform Windows
Header winnls.h (include Windows.h)
Library Kernel32.lib
DLL Kernel32.dll

See Also

GetLocaleInfoEx

IsValidLocale

National Language Support

National Language Support Functions