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