Locale Categories

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at Locale Categories.

Syntax

  
#include <locale.h>  
  

Locale categories are manifest constants used by the localization routines to specify which portion of a program's locale information will be used. The locale refers to the locality (or Country/Region) for which certain aspects of your program can be customized. Locale-dependent areas include, for example, the formatting of dates or the display format for monetary values.

Locale categoryParts of program affected
LC_ALLAll locale-specific behavior (all categories)
LC_COLLATEBehavior of strcoll and strxfrm functions
LC_CTYPEBehavior of character-handling functions (except isdigit, isxdigit, mbstowcs, and mbtowc, which are unaffected)
LC_MAXSame as LC_TIME
LC_MINSame as LC_ALL
LC_MONETARYMonetary formatting information returned by the localeconv function
LC_NUMERICDecimal-point character for formatted output routines (for example, printf), data conversion routines, and nonmonetary formatting information returned by localeconv function
LC_TIMEBehavior of strftime function

See setlocale, _wsetlocale for an example.

localeconv
setlocale, _wsetlocale
strcoll Functions
strftime, wcsftime, _strftime_l, _wcsftime_l
strxfrm, wcsxfrm, _strxfrm_l, _wcsxfrm_l
Global Constants

Show: