1 .\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de)
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date. The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein. The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" Modified Sat Jul 24 17:28:34 1993 by Rik Faith <faith@cs.unc.edu>
24 .\" Modified Sun Jun 01 17:16:34 1997 by Jochen Hein
25 .\" <jochen.hein@delphi.central.de>
26 .\" Modified Thu Apr 25 00:43:19 2002 by Bruno Haible <bruno@clisp.org>
28 .TH LOCALE 7 2008-12-05 "Linux" "Linux Programmer's Manual"
30 locale \- Description of multilanguage support
33 .B #include <locale.h>
36 A locale is a set of language and cultural rules.
38 such as language for messages, different character sets, lexicographic
40 A program needs to be able to determine its locale
41 and act accordingly to be portable to different cultures.
45 declares data types, functions and macros which are useful in this
48 The functions it declares are
50 to set the current locale, and
52 to get information about number formatting.
54 There are different categories for local information a program might
55 need; they are declared as macros.
56 Using them as the first argument
59 function, it is possible to set one of these to the desired locale:
62 This is used to change the behavior of the functions
66 which are used to compare strings in the local alphabet.
68 the German sharp s is sorted as "ss".
71 This changes the behavior of the character handling and
72 classification functions, such as
76 and the multibyte character functions such as
82 changes the information returned by
84 which describes the way numbers are usually printed, with details such
85 as decimal point versus decimal comma.
86 This information is internally
91 changes the language messages are displayed in and what an affirmative or
92 negative answer looks like.
93 The GNU C-library contains the
98 functions to ease the use of these information.
99 The GNU gettext family of
100 functions also obey the environment variable
102 (containing a colon-separated list of locales)
103 if the category is set to a valid locale other than
107 changes the information used by the
111 family of functions, when they are advised to use the locale-settings.
112 This information can also be read with the
117 changes the behavior of the
119 function to display the current time in a locally acceptable form; for
120 example, most of Europe uses a 24-hour clock versus the
121 12-hour clock used in the United States.
125 .\" FIXME glibc 2.2.2 added new nonstandard locale categories:
126 .\" LC_ADDRESS, LC_IDENTIFICATION, LC_MEASUREMENT, LC_NAME,
127 .\" LC_PAPER, LC_TELEPHONE. These need to be documented.
129 If the second argument to
133 for the default locale, it is determined using the following steps:
135 If there is a non-null environment variable
141 If an environment variable with the same name as one of the categories
142 above exists and is non-null, its value is used for that category.
144 If there is a non-null environment variable
150 Values about local numeric formatting is made available in a
154 function, which has the following declaration:
160 /* Numeric (nonmonetary) information */
162 char *decimal_point; /* Radix character */
163 char *thousands_sep; /* Separator for digit groups to left
164 of radix character */
165 char *grouping; /* Each element is the number of digits in a
166 group; elements with higher indices are
167 further left. An element with value CHAR_MAX
168 means that no further grouping is done. An
169 element with value 0 means that the previous
170 element is used for all groups further left. */
172 /* Remaining fields are for monetary information */
174 char *int_curr_symbol; /* First three chars are a currency symbol
175 from ISO 4217. Fourth char is the
176 separator. Fifth char is \(aq\\0\(aq. */
177 char *currency_symbol; /* Local currency symbol */
178 char *mon_decimal_point; /* Radix character */
179 char *mon_thousands_sep; /* Like \fIthousands_sep\fP above */
180 char *mon_grouping; /* Like \fIgrouping\fP above */
181 char *positive_sign; /* Sign for positive values */
182 char *negative_sign; /* Sign for negative values */
183 char int_frac_digits; /* International fractional digits */
184 char frac_digits; /* Local fractional digits */
185 char p_cs_precedes; /* 1 if currency_symbol precedes a
186 positive value, 0 if succeeds */
187 char p_sep_by_space; /* 1 if a space separates currency_symbol
188 from a positive value */
189 char n_cs_precedes; /* 1 if currency_symbol precedes a
190 negative value, 0 if succeeds */
191 char n_sep_by_space; /* 1 if a space separates currency_symbol
192 from a negative value */
193 /* Positive and negative sign positions:
194 0 Parentheses surround the quantity and currency_symbol.
195 1 The sign string precedes the quantity and currency_symbol.
196 2 The sign string succeeds the quantity and currency_symbol.
197 3 The sign string immediately precedes the currency_symbol.
198 4 The sign string immediately succeeds the currency_symbol. */
207 The GNU gettext functions are specified in LI18NUX2000.