Expand Minimize

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(
  _In_  LPCWSTR lpLocaleName
);

Parameters

lpLocaleName [in]

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.

Windows Phone 8: This API is supported.

Windows Phone 8.1: This API is supported.

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 | Windows Store apps]

Minimum supported server

Windows Server 2008 [desktop apps | Windows Store apps]

Header

Winnls.h (include Windows.h)

Library

Kernel32.lib

DLL

Kernel32.dll

See also

National Language Support
National Language Support Functions
GetLocaleInfoEx
IsValidLocale

 

 

Community Additions

ADD
Show:
© 2014 Microsoft