locale(7) Miscellaneous Information Manual locale(7) locale - #include -- . : , , .. . The header declares data types, functions, and macros which are useful in this task. : setlocale(3), localeconv(3), . , ; . setlocale(3), : LC_ADDRESS ( GNU, glibc 2.2) , (, ), . , , nl_langinfo(3) , _NL_ADDRESS_COUNTRY_NAME ( ) _NL_ADDRESS_LANG_NAME ( ), , <> <> ( ) ( ). LC_COLLATE , , . strcoll(3) strxfrm(3), . , (sharp s) <>. LC_CTYPE (, ), (, ) . glibc iconv(1) iconv(3). , isupper(3) toupper(3), , mblen(3) wctomb(3). LC_IDENTIFICATION ( GNU, glibc 2.2) , . , , nl_langinfo(3) , _NL_IDENTIFICATION_TITLE ( ) _NL_IDENTIFICATION_TERRITORY ( , ), , <> <> ( ). LC_MONETARY , . , localeconv(3) , , , . strfmon(3). LC_MESSAGES , . GNU C gettext(3), ngettext(3) rpmatch(3) . GNU gettext LANGUAGE ( ), , "C". catopen(3). LC_MEASUREMENT ( GNU, glibc 2.2) , ( , (US customary unit)). , , nl_langinfo(3) _NL_MEASUREMENT_MEASUREMENT, 1 () 2 ( ). LC_NAME ( GNU, glibc 2.2) , , . , , nl_langinfo(3) , _NL_NAME_NAME_MR ( ) _NL_NAME_NAME_MS ( ), , <> <> ( ) ( ). LC_NUMERIC This category determines the formatting rules used for nonmonetary numeric values--for example, the thousands separator and the radix character (a period in most English-speaking countries, but a comma in many other regions). It affects functions such as printf(3), scanf(3), and strtod(3). This information can also be read with the localeconv(3) function. LC_PAPER ( GNU, glibc 2.2) , (, A4). , , nl_langinfo(3) , _NL_PAPER_WIDTH _NL_PAPER_HEIGHT int, . LC_TELEPHONE ( GNU, glibc 2.2) , , . , , nl_langinfo(3) , _NL_TELEPHONE_INT_PREFIX ( , ), , <<49>> ( ) ( ). LC_TIME . , 24- , 12-. strftime(3) strptime(3). LC_ALL . If the second argument to setlocale(3) is an empty string, "", for the default locale, it is determined using the following steps: (1) LC_ALL, . (2) , . (3) LANG, . struct lconv, localeconv(3) , : struct lconv { /* Numeric (nonmonetary) information */ char *decimal_point; /* Radix character */ char *thousands_sep; /* Separator for digit groups to left of radix character */ char *grouping; /* Each element is the number of digits in a group; elements with higher indices are further left. An element with value CHAR_MAX means that no further grouping is done. An element with value 0 means that the previous element is used for all groups further left. */ /* Remaining fields are for monetary information */ char *int_curr_symbol; /* First three chars are a currency symbol from ISO 4217. Fourth char is the separator. Fifth char is '\0'. */ char *currency_symbol; /* Local currency symbol */ char *mon_decimal_point; /* Radix character */ char *mon_thousands_sep; /* Like thousands_sep above */ char *mon_grouping; /* Like grouping above */ char *positive_sign; /* Sign for positive values */ char *negative_sign; /* Sign for negative values */ char int_frac_digits; /* International fractional digits */ char frac_digits; /* Local fractional digits */ char p_cs_precedes; /* 1 if currency_symbol precedes a positive value, 0 if succeeds */ char p_sep_by_space; /* 1 if a space separates currency_symbol from a positive value */ char n_cs_precedes; /* 1 if currency_symbol precedes a negative value, 0 if succeeds */ char n_sep_by_space; /* 1 if a space separates currency_symbol from a negative value */ /* Positive and negative sign positions: 0 Parentheses surround the quantity and currency_symbol. 1 The sign string precedes the quantity and currency_symbol. 2 The sign string succeeds the quantity and currency_symbol. 3 The sign string immediately precedes the currency_symbol. 4 The sign string immediately succeeds the currency_symbol. */ char p_sign_posn; char n_sign_posn; }; POSIX.1-2008 POSIX.1-2008 standardized a number of extensions to the locale API, based on implementations that first appeared in glibc 2.3. These extensions are designed to address the problem that the traditional locale APIs do not mix well with multithreaded applications and with applications that must deal with multiple locales. (newlocale(3), freelocale(3), duplocale(3) uselocale(3)) <<_l>> (, toupper_l(3)), (, toupper(3)) , , . newlocale(3) setlocale(3), : LOCPATH A list of pathnames, separated by colons (':'), that should be used to find locale data. If this variable is set, only the individual compiled locale data files from LOCPATH and the system default locale data path are used; any available locale archives are not used (see localedef(1)). The individual compiled locale data files are searched for under subdirectories which depend on the currently used locale. For example, when en_GB.UTF-8 is used for a category, the following subdirectories are searched for, in this order: en_GB.UTF-8, en_GB.utf8, en_GB, en.UTF-8, en.utf8, and en. /usr/lib/locale/locale-archive . /usr/lib/locale . POSIX.1-2001. . iconv(1), locale(1), localedef(1), catopen(3), gettext(3), iconv(3), localeconv(3), mbstowcs(3), newlocale(3), ngettext(3), nl_langinfo(3), rpmatch(3), setlocale(3), strcoll(3), strfmon(3), strftime(3), strxfrm(3), uselocale(3), wcstombs(3), locale(5), charsets(7), unicode(7), utf-8(7) Artyom Kunyov , Azamat Hackimov , Dmitry Bolkhovskikh , Katrin Kutepova , Konstantin Shvaykovskiy , Yuri Kozlov ; GNU 3 , . . , , . Linux man-pages 6.06 31 2023 . locale(7)