C++ Standard Library C++ STL Library

C++ - <clocale> (locale.h)



The C++ <clocale> header supports localization specific settings, such as culture-specific date formats or country-specific currency symbols. Each system and specific compiler implementation may provide different choices of locales to be selected (using setlocale() function), but at least two locales are available to choose for any C++ program:

  • "C" - A minimal locale or rather neutral locale which has the same settings across all systems and compilers. It is the locale used by default on all C programs.
  • "" - Environment's default locale. It is the locale configuration provided by the environment where the application is running. This usually contains more localization information than the "C" locale.

These functions, types and macros are available to use in a current program after including the header file using - #include <clocale> or #include <locale.h>. All functions, types and macros of this header file are listed below:

Library Functions

FunctionsDescription
setlocale Set or retrieve locale.
localeconv Get numeric and monetary formatting details of the current locale.

Library Types

TypesDescription
lconv Formatting details, returned by localeconv() function.

Library Macros

Macro constants

MacrosDescription
LC_ALL
LC_COLLATE
LC_CTYPE
LC_MONETARY
LC_NUMERIC
LC_TIME
locale categories for setlocale() function.