1 .\" (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 1993-04-24 "Linux" "Linux Programmer's Manual"
30 locale \- Description of multi-language support
33 .B #include <locale.h>
36 A locale is a set of language and cultural rules. These cover aspects
37 such as language for messages, different character sets, lexigraphic
38 conventions, etc. A program needs to be able to determine its locale
39 and act accordingly to be portable to different cultures.
43 declares data types, functions and macros which are useful in this
46 The functions it declares are
48 to set the current locale, and
50 to get information about number formatting.
52 There are different categories for local information a program might
53 need; they are declared as macros. Using them as the first argument
56 function, it is possible to set one of these to the desired locale:
59 This is used to change the behaviour of the functions
63 which are used to compare strings in the local alphabet. For example,
64 the German sharp s is sorted as "ss".
67 This changes the behaviour of the character handling and
68 classification functions, such as
72 and the multi\-byte character functions such as
78 changes the information returned by
80 which describes the way numbers are usually printed, with details such
81 as decimal point versus decimal comma. This information is internally
86 changes the language messages are displayed in and how an affirmative or
87 negative answer looks like. The GNU C-library contains the
92 functions to ease the use of these information. The GNU gettext family of
93 functions also obey the environment variable
97 changes the information used by the
101 family of functions, when they are advised to use the
102 locale-settings. This information can also be read with the
107 changes the behaviour of the
109 function to display the current time in a locally acceptable form; for
110 example, most of Europe uses a 24\-hour clock vs. the US' 12\-hour
116 If the second argument to
120 for the default locale, it is determined using the following steps:
122 If there is a non-null environment variable
128 If an environment variable with the same name as one of the categories
129 above exists and is non-null, its value is used for that category.
131 If there is a non-null environment variable
137 Values about local numeric formatting is made available in a
141 function, which has the following declaration:
145 /* Numeric (non-monetary) information. */
147 char *decimal_point; /* Decimal point character. */
148 char *thousands_sep; /* Thousands separator. */
149 /* Each element is the number of digits in each group;
150 elements with higher indices are farther left.
151 An element with value CHAR_MAX means that no further grouping is done.
152 An element with value 0 means that the previous element is used
153 for all groups farther left. */
156 /* Monetary information. */
158 /* First three chars are a currency symbol from ISO 4217.
159 Fourth char is the separator. Fifth char is '\0'. */
160 char *int_curr_symbol;
161 char *currency_symbol; /* Local currency symbol. */
162 char *mon_decimal_point; /* Decimal point character. */
163 char *mon_thousands_sep; /* Thousands separator. */
164 char *mon_grouping; /* Like `grouping' element (above). */
165 char *positive_sign; /* Sign for positive values. */
166 char *negative_sign; /* Sign for negative values. */
167 char int_frac_digits; /* Int'l fractional digits. */
168 char frac_digits; /* Local fractional digits. */
169 /* 1 if currency_symbol precedes a positive value, 0 if succeeds. */
171 /* 1 if a space separates currency_symbol from a positive value. */
173 /* 1 if currency_symbol precedes a negative value, 0 if succeeds. */
175 /* 1 if a space separates currency_symbol from a negative value. */
177 /* Positive and negative sign positions:
178 0 Parentheses surround the quantity and currency_symbol.
179 1 The sign string precedes the quantity and currency_symbol.
180 2 The sign string succeeds the quantity and currency_symbol.
181 3 The sign string immediately precedes the currency_symbol.
182 4 The sign string immediately succeeds the currency_symbol. */
191 The GNU gettext functions are specified in LI18NUX2000.