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 .\" FIXME Document LOCPATH;
29 .\" see http://sourceware.org/bugzilla/show_bug.cgi?id=174
30 .TH LOCALE 7 2008-12-05 "Linux" "Linux Programmer's Manual"
32 locale \- Description of multilanguage support
35 .B #include <locale.h>
38 A locale is a set of language and cultural rules.
40 such as language for messages, different character sets, lexicographic
41 conventions, and so on.
42 A program needs to be able to determine its locale
43 and act accordingly to be portable to different cultures.
47 declares data types, functions and macros which are useful in this
50 The functions it declares are
52 to set the current locale, and
54 to get information about number formatting.
56 There are different categories for local information a program might
57 need; they are declared as macros.
58 Using them as the first argument
61 function, it is possible to set one of these to the desired locale:
64 This is used to change the behavior of the functions
68 which are used to compare strings in the local alphabet.
70 the German sharp s is sorted as "ss".
73 This changes the behavior of the character handling and
74 classification functions, such as
78 and the multibyte character functions such as
84 changes the information returned by
86 which describes the way numbers are usually printed, with details such
87 as decimal point versus decimal comma.
88 This information is internally
93 changes the language messages are displayed in and what an affirmative or
94 negative answer looks like.
95 The GNU C-library contains the
100 functions to ease the use of these information.
101 The GNU gettext family of
102 functions also obey the environment variable
104 (containing a colon-separated list of locales)
105 if the category is set to a valid locale other than
109 changes the information used by the
113 family of functions, when they are advised to use the locale-settings.
114 This information can also be read with the
119 changes the behavior of the
121 function to display the current time in a locally acceptable form; for
122 example, most of Europe uses a 24-hour clock versus the
123 12-hour clock used in the United States.
127 .\" FIXME glibc 2.2.2 added new nonstandard locale categories:
128 .\" LC_ADDRESS, LC_IDENTIFICATION, LC_MEASUREMENT, LC_NAME,
129 .\" LC_PAPER, LC_TELEPHONE. These need to be documented.
131 If the second argument to
135 for the default locale, it is determined using the following steps:
137 If there is a non-null environment variable
143 If an environment variable with the same name as one of the categories
144 above exists and is non-null, its value is used for that category.
146 If there is a non-null environment variable
152 Values about local numeric formatting is made available in a
156 function, which has the following declaration:
162 /* Numeric (nonmonetary) information */
164 char *decimal_point; /* Radix character */
165 char *thousands_sep; /* Separator for digit groups to left
166 of radix character */
167 char *grouping; /* Each element is the number of digits in a
168 group; elements with higher indices are
169 further left. An element with value CHAR_MAX
170 means that no further grouping is done. An
171 element with value 0 means that the previous
172 element is used for all groups further left. */
174 /* Remaining fields are for monetary information */
176 char *int_curr_symbol; /* First three chars are a currency symbol
177 from ISO 4217. Fourth char is the
178 separator. Fifth char is \(aq\\0\(aq. */
179 char *currency_symbol; /* Local currency symbol */
180 char *mon_decimal_point; /* Radix character */
181 char *mon_thousands_sep; /* Like \fIthousands_sep\fP above */
182 char *mon_grouping; /* Like \fIgrouping\fP above */
183 char *positive_sign; /* Sign for positive values */
184 char *negative_sign; /* Sign for negative values */
185 char int_frac_digits; /* International fractional digits */
186 char frac_digits; /* Local fractional digits */
187 char p_cs_precedes; /* 1 if currency_symbol precedes a
188 positive value, 0 if succeeds */
189 char p_sep_by_space; /* 1 if a space separates currency_symbol
190 from a positive value */
191 char n_cs_precedes; /* 1 if currency_symbol precedes a
192 negative value, 0 if succeeds */
193 char n_sep_by_space; /* 1 if a space separates currency_symbol
194 from a negative value */
195 /* Positive and negative sign positions:
196 0 Parentheses surround the quantity and currency_symbol.
197 1 The sign string precedes the quantity and currency_symbol.
198 2 The sign string succeeds the quantity and currency_symbol.
199 3 The sign string immediately precedes the currency_symbol.
200 4 The sign string immediately succeeds the currency_symbol. */
209 The GNU gettext functions are specified in LI18NUX2000.