CARVIEW |
Select Language
HTTP/1.1 301 Moved Permanently
Server: nginx
Date: Thu, 31 Jul 2025 04:31:09 GMT
Content-Type: text/html; charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
Location: /reference/clocale/
HTTP/1.1 200 OK
Server: nginx
Date: Thu, 31 Jul 2025 04:31:09 GMT
Content-Type: text/html; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
ETag: W/"60ed-3wRKj1LEEiVC7G2HwSTTptCs6Wg"
Content-Encoding: gzip
The C language 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 function setlocale), but at least two locales are available to choose for any C program:
This header declares the struct lconv and the functions setlocale and localeconv, along with several macros to be used with them. These are used to define locale-specific information.
Notice that locale configuration affects the behavior of many functions within the standard C library:
Some locale information is also provided to programs to better render its output in a locale-sensitive manner (localeconv).
Reference
C library:
- <cassert> (assert.h)
- <cctype> (ctype.h)
- <cerrno> (errno.h)
-
<cfenv> (fenv.h)C++11
- <cfloat> (float.h)
-
<cinttypes> (inttypes.h)C++11
- <ciso646> (iso646.h)
- <climits> (limits.h)
- <clocale> (locale.h)
- <cmath> (math.h)
- <csetjmp> (setjmp.h)
- <csignal> (signal.h)
- <cstdarg> (stdarg.h)
-
<cstdbool> (stdbool.h)C++11
- <cstddef> (stddef.h)
-
<cstdint> (stdint.h)C++11
- <cstdio> (stdio.h)
- <cstdlib> (stdlib.h)
- <cstring> (string.h)
-
<ctgmath> (tgmath.h)C++11
- <ctime> (time.h)
-
<cuchar> (uchar.h)C++11
- <cwchar> (wchar.h)
- <cwctype> (wctype.h)
Containers:
-
<array>C++11
- <deque>
-
<forward_list>C++11
- <list>
- <map>
- <queue>
- <set>
- <stack>
-
<unordered_map>C++11
-
<unordered_set>C++11
- <vector>
-
Input/Output:
Multi-threading:
-
<atomic>C++11
-
<condition_variable>C++11
-
<future>C++11
-
<mutex>C++11
-
<thread>C++11
-
Other:
- <algorithm>
- <bitset>
-
<chrono>C++11
-
<codecvt>C++11
- <complex>
- <exception>
- <functional>
-
<initializer_list>C++11
- <iterator>
- <limits>
- <locale>
- <memory>
- <new>
- <numeric>
-
<random>C++11
-
<ratio>C++11
-
<regex>C++11
- <stdexcept>
- <string>
-
<system_error>C++11
-
<tuple>C++11
-
<type_traits>C++11
-
<typeindex>C++11
- <typeinfo>
- <utility>
- <valarray>
<clocale> (locale.h)
functions
macros
types
- Reference
- <clocale>
header
<clocale> (locale.h)
C localization library
Each system and specific compiler implementation may provide different choices of locales to be selected (using function setlocale), but at least two locales are available to choose for any C program:
- The
"C"
locale is the minimal locale. It is a rather neutral locale which has the same settings across all systems and compilers, and therefore the exact results of a program using this locale are predictable. This is the locale used by default on all C programs. - The system's default locale (which is specified by an empty C-string: ""). It is the locale configuration provided by the environment where the application is running. This usually contains more localization information than the "C" locale.
This header declares the struct lconv and the functions setlocale and localeconv, along with several macros to be used with them. These are used to define locale-specific information.
Notice that locale configuration affects the behavior of many functions within the standard C library:
- In
<cstring>
(<string.h>
), functions strcoll and strxfrm are affected by character transformation rules. - In
<cctype>
(<ctype.h>
), all functions except isdigit and isxdigit are affected by the extended character set selected. - In
<cstdio>
(<stdio.h>
), formatted input/output operations are affected by character transformation rules and decimal-point character set in the numeric formatting settings. - In
<ctime>
(<time.h>
), the function strftime is affected by the time formatting settings. - In this header, it affects the value returned by its functions setlocale and localeconv.
Some locale information is also provided to programs to better render its output in a locale-sensitive manner (localeconv).
- struct lconv
- Formatting info for numeric values (type)
Functions
- setlocale
- Set or retrieve locale (function)
- localeconv
- Get locale formatting parameters for quantities (function)
Home page | Privacy policy
© cplusplus.com, 2000-2025 - All rights reserved - v3.3.4s
Spotted an error? contact us
© cplusplus.com, 2000-2025 - All rights reserved - v3.3.4s
Spotted an error? contact us