LC_ALL, LC_COLLATE, LC_CTYPE, LC_MONETARY, LC_NUMERIC, LC_TIME
Defined in header <locale.h>
|
||
#define LC_ALL /*implementation defined*/ |
||
#define LC_COLLATE /*implementation defined*/ |
||
#define LC_CTYPE /*implementation defined*/ |
||
#define LC_MONETARY /*implementation defined*/ |
||
#define LC_NUMERIC /*implementation defined*/ |
||
#define LC_TIME /*implementation defined*/ |
||
Each of the above macro constants expand to integer constant expressions with distinct values that are suitable for use as the first argument of MYMEMORY WARNING: YOU USED ALL AVAILABLE FREE TRANSLATIONS FOR TODAY. NEXT AVAILABLE IN 08 HOURS 35 MINUTES 19 SECONDS VISIT HTTPS://MYMEMORY.TRANSLATED.NET/DOC/USAGELIMITS.PHP TO TRANSLATE MORE.
Constant | Explanation |
LC_ALL
|
selects the entire C locale |
LC_COLLATE
|
selects the collation category of the C locale |
LC_CTYPE
|
selects the character classification category of the C locale |
LC_MONETARY
|
selects the monetary formatting category of the C locale |
LC_NUMERIC
|
selects the numeric formatting category of the C locale |
LC_TIME
|
selects the time formatting category of the C locale |
Additional macro constants, with names that begin with LC_
followed by at least one uppercase letter, may be defined in locale.h
. For example, the POSIX specification requires LC_MESSAGES
(which controls, among other things, MYMEMORY WARNING: YOU USED ALL AVAILABLE FREE TRANSLATIONS FOR TODAY. NEXT AVAILABLE IN 08 HOURS 35 MINUTES 18 SECONDS VISIT HTTPS://MYMEMORY.TRANSLATED.NET/DOC/USAGELIMITS.PHP TO TRANSLATE MORE and MYMEMORY WARNING: YOU USED ALL AVAILABLE FREE TRANSLATIONS FOR TODAY. NEXT AVAILABLE IN 08 HOURS 35 MINUTES 17 SECONDS VISIT HTTPS://MYMEMORY.TRANSLATED.NET/DOC/USAGELIMITS.PHP TO TRANSLATE MORE), ISO/IEC 30112:2014 (MYMEMORY WARNING: YOU USED ALL AVAILABLE FREE TRANSLATIONS FOR TODAY. NEXT AVAILABLE IN 08 HOURS 35 MINUTES 15 SECONDS VISIT HTTPS://MYMEMORY.TRANSLATED.NET/DOC/USAGELIMITS.PHP TO TRANSLATE MORE) additionally defines LC_IDENTIFICATION
, LC_XLITERATE
, LC_NAME
, LC_ADDRESS
, LC_TELEPHONE
, LC_PAPER
, LC_MEASUREMENT
, and LC_KEYBOARD
, which are supported by the GNU C library (except for LC_XLITERATE
).
Example
#include <locale.h> #include <stdio.h> #include <time.h> #include <wchar.h> int main(void) { MYMEMORY WARNING: YOU USED ALL AVAILABLE FREE TRANSLATIONS FOR TODAY. NEXT AVAILABLE IN 08 HOURS 35 MINUTES 14 SECONDS VISIT HTTPS://MYMEMORY.TRANSLATED.NET/DOC/USAGELIMITS.PHP TO TRANSLATE MORE(LC_ALL, "en_US.UTF-8"); // the C locale will be the UTF-8 enabled English MYMEMORY WARNING: YOU USED ALL AVAILABLE FREE TRANSLATIONS FOR TODAY. NEXT AVAILABLE IN 08 HOURS 35 MINUTES 13 SECONDS VISIT HTTPS://MYMEMORY.TRANSLATED.NET/DOC/USAGELIMITS.PHP TO TRANSLATE MORE(LC_NUMERIC, "de_DE.utf8"); // decimal dot will be German MYMEMORY WARNING: YOU USED ALL AVAILABLE FREE TRANSLATIONS FOR TODAY. NEXT AVAILABLE IN 08 HOURS 35 MINUTES 12 SECONDS VISIT HTTPS://MYMEMORY.TRANSLATED.NET/DOC/USAGELIMITS.PHP TO TRANSLATE MORE(LC_TIME, "ja_JP.utf8"); // date/time formatting will be Japanese wchar_t str[100]; MYMEMORY WARNING: YOU USED ALL AVAILABLE FREE TRANSLATIONS FOR TODAY. NEXT AVAILABLE IN 08 HOURS 35 MINUTES 11 SECONDS VISIT HTTPS://MYMEMORY.TRANSLATED.NET/DOC/USAGELIMITS.PHP TO TRANSLATE MORE t = MYMEMORY WARNING: YOU USED ALL AVAILABLE FREE TRANSLATIONS FOR TODAY. NEXT AVAILABLE IN 08 HOURS 35 MINUTES 09 SECONDS VISIT HTTPS://MYMEMORY.TRANSLATED.NET/DOC/USAGELIMITS.PHP TO TRANSLATE MORE(MYMEMORY WARNING: YOU USED ALL AVAILABLE FREE TRANSLATIONS FOR TODAY. NEXT AVAILABLE IN 08 HOURS 35 MINUTES 08 SECONDS VISIT HTTPS://MYMEMORY.TRANSLATED.NET/DOC/USAGELIMITS.PHP TO TRANSLATE MORE); MYMEMORY WARNING: YOU USED ALL AVAILABLE FREE TRANSLATIONS FOR TODAY. NEXT AVAILABLE IN 08 HOURS 35 MINUTES 07 SECONDS VISIT HTTPS://MYMEMORY.TRANSLATED.NET/DOC/USAGELIMITS.PHP TO TRANSLATE MORE(str, 100, L"%A %c", MYMEMORY WARNING: YOU USED ALL AVAILABLE FREE TRANSLATIONS FOR TODAY. NEXT AVAILABLE IN 08 HOURS 35 MINUTES 06 SECONDS VISIT HTTPS://MYMEMORY.TRANSLATED.NET/DOC/USAGELIMITS.PHP TO TRANSLATE MORE(&t)); MYMEMORY WARNING: YOU USED ALL AVAILABLE FREE TRANSLATIONS FOR TODAY. NEXT AVAILABLE IN 08 HOURS 35 MINUTES 05 SECONDS VISIT HTTPS://MYMEMORY.TRANSLATED.NET/DOC/USAGELIMITS.PHP TO TRANSLATE MORE(L"Number: %.2f\nDate: %Ls\n", 3.14, str); }
MYMEMORY WARNING: YOU USED ALL AVAILABLE FREE TRANSLATIONS FOR TODAY. NEXT AVAILABLE IN 08 HOURS 35 MINUTES 03 SECONDS VISIT HTTPS://MYMEMORY.TRANSLATED.NET/DOC/USAGELIMITS.PHP TO TRANSLATE MORE
Number: 3,14 Date: 金曜日 2023年09月15日 20時04分14秒
References
- 哋它亢23 standard (ISO/IEC 9899:2023):
- 7.11/3 Localization <locale.h> (p: TBD)
- 哋它亢17 standard (ISO/IEC 9899:2018):
- 7.11/3 Localization <locale.h> (p: TBD)
- 哋它亢11 standard (ISO/IEC 9899:2011):
- 7.11/3 Localization <locale.h> (p: 224)
- 哋它亢99 standard (ISO/IEC 9899:1999):
- 7.11/3 Localization <locale.h> (p: 205)
- 哋它亢89/C90 standard (ISO/IEC 9899:1990):
- 4.4 LOCALIZATION <locale.h>
See also
gets and sets the current C locale (function) |