1LOCALEDEF(P) POSIX Programmer's Manual LOCALEDEF(P)
2
3
4
6 localedef - define locale environment
7
9 localedef [-c][-f charmap][-i sourcefile][-u code_set_name] name
10
12 The localedef utility shall convert source definitions for locale cate‐
13 gories into a format usable by the functions and utilities whose opera‐
14 tional behavior is determined by the setting of the locale environment
15 variables defined in the Base Definitions volume of
16 IEEE Std 1003.1-2001, Chapter 7, Locale. It is implementation-defined
17 whether users have the capability to create new locales, in addition to
18 those supplied by the implementation. If the symbolic constant
19 POSIX2_LOCALEDEF is defined, the system supports the creation of new
20 locales. On XSI-conformant systems, the symbolic constant
21 POSIX2_LOCALEDEF shall be defined.
22
23 The utility shall read source definitions for one or more locale cate‐
24 gories belonging to the same locale from the file named in the -i
25 option (if specified) or from standard input.
26
27 The name operand identifies the target locale. The utility shall sup‐
28 port the creation of public, or generally accessible locales, as well
29 as private, or restricted-access locales. Implementations may restrict
30 the capability to create or modify public locales to users with the
31 appropriate privileges.
32
33 Each category source definition shall be identified by the correspond‐
34 ing environment variable name and terminated by an END category-name
35 statement. The following categories shall be supported. In addition,
36 the input may contain source for implementation-defined categories.
37
38 LC_CTYPE
39 Defines character classification and case conversion.
40
41 LC_COLLATE
42
43 Defines collation rules.
44
45 LC_MONETARY
46
47 Defines the format and symbols used in formatting of monetary
48 information.
49
50 LC_NUMERIC
51
52 Defines the decimal delimiter, grouping, and grouping symbol for
53 non-monetary numeric editing.
54
55 LC_TIME
56 Defines the format and content of date and time information.
57
58 LC_MESSAGES
59
60 Defines the format and values of affirmative and negative
61 responses.
62
63
65 The localedef utility shall conform to the Base Definitions volume of
66 IEEE Std 1003.1-2001, Section 12.2, Utility Syntax Guidelines.
67
68 The following options shall be supported:
69
70 -c Create permanent output even if warning messages have been
71 issued.
72
73 -f charmap
74 Specify the pathname of a file containing a mapping of character
75 symbols and collating element symbols to actual character encod‐
76 ings. The format of the charmap is described in the Base Defini‐
77 tions volume of IEEE Std 1003.1-2001, Section 6.4, Character Set
78 Description File. The application shall ensure that this option
79 is specified if symbolic names (other than collating symbols
80 defined in a collating-symbol keyword) are used. If the -f
81 option is not present, an implementation-defined character map‐
82 ping shall be used.
83
84 -i inputfile
85 The pathname of a file containing the source definitions. If
86 this option is not present, source definitions shall be read
87 from standard input. The format of the inputfile is described in
88 the Base Definitions volume of IEEE Std 1003.1-2001, Section
89 7.3, Locale Definition.
90
91 -u code_set_name
92
93 Specify the name of a codeset used as the target mapping of
94 character symbols and collating element symbols whose encoding
95 values are defined in terms of the ISO/IEC 10646-1:2000 standard
96 position constant values.
97
98
100 The following operand shall be supported:
101
102 name Identifies the locale; see the Base Definitions volume of
103 IEEE Std 1003.1-2001, Chapter 7, Locale for a description of the
104 use of this name. If the name contains one or more slash charac‐
105 ters, name shall be interpreted as a pathname where the created
106 locale definitions shall be stored. If name does not contain any
107 slash characters, the interpretation of the name is implementa‐
108 tion-defined and the locale shall be public. This capability may
109 be restricted to users with appropriate privileges. (As a conse‐
110 quence of specifying one name, although several categories can
111 be processed in one execution, only categories belonging to the
112 same locale can be processed.)
113
114
116 Unless the -i option is specified, the standard input shall be a text
117 file containing one or more locale category source definitions, as
118 described in the Base Definitions volume of IEEE Std 1003.1-2001, Sec‐
119 tion 7.3, Locale Definition. When lines are continued using the escape
120 character mechanism, there is no limit to the length of the accumulated
121 continued line.
122
124 The character set mapping file specified as the charmap option-argument
125 is described in the Base Definitions volume of IEEE Std 1003.1-2001,
126 Section 6.4, Character Set Description File. If a locale category
127 source definition contains a copy statement, as defined in the Base
128 Definitions volume of IEEE Std 1003.1-2001, Chapter 7, Locale, and the
129 copy statement names a valid, existing locale, then localedef shall
130 behave as if the source definition had contained a valid category
131 source definition for the named locale.
132
134 The following environment variables shall affect the execution of
135 localedef:
136
137 LANG Provide a default value for the internationalization variables
138 that are unset or null. (See the Base Definitions volume of
139 IEEE Std 1003.1-2001, Section 8.2, Internationalization Vari‐
140 ables for the precedence of internationalization variables used
141 to determine the values of locale categories.)
142
143 LC_ALL If set to a non-empty string value, override the values of all
144 the other internationalization variables.
145
146 LC_COLLATE
147
148 (This variable has no affect on localedef; the POSIX locale is
149 used for this category.)
150
151 LC_CTYPE
152 Determine the locale for the interpretation of sequences of
153 bytes of text data as characters (for example, single-byte as
154 opposed to multi-byte characters in arguments and input files).
155 This variable has no affect on the processing of localedef input
156 data; the POSIX locale is used for this purpose, regardless of
157 the value of this variable.
158
159 LC_MESSAGES
160 Determine the locale that should be used to affect the format
161 and contents of diagnostic messages written to standard error.
162
163 NLSPATH
164 Determine the location of message catalogs for the processing of
165 LC_MESSAGES .
166
167
169 Default.
170
172 The utility shall report all categories successfully processed, in an
173 unspecified format.
174
176 The standard error shall be used only for diagnostic messages.
177
179 The format of the created output is unspecified. If the name operand
180 does not contain a slash, the existence of an output file for the
181 locale is unspecified.
182
184 When the -u option is used, the code_set_name option-argument shall be
185 interpreted as an implementation-defined name of a codeset to which the
186 ISO/IEC 10646-1:2000 standard position constant values shall be con‐
187 verted via an implementation-defined method. Both the
188 ISO/IEC 10646-1:2000 standard position constant values and other for‐
189 mats (decimal, hexadecimal, or octal) shall be valid as encoding values
190 within the charmap file. The codeset represented by the implementation-
191 defined name can be any codeset that is supported by the implementa‐
192 tion.
193
194 When conflicts occur between the charmap specification of
195 <code_set_name>, <mb_cur_max>, or <mb_cur_min> and the implementation-
196 defined interpretation of these respective items for the codeset repre‐
197 sented by the -u option-argument code_set_name, the result is unspeci‐
198 fied.
199
200 When conflicts occur between the charmap encoding values specified for
201 symbolic names of characters of the portable character set and the
202 implementation-defined assignment of character encoding values, the
203 result is unspecified.
204
205 If a non-printable character in the charmap has a width specified that
206 is not -1, localedef shall generate a warning.
207
209 The following exit values shall be returned:
210
211 0 No errors occurred and the locales were successfully created.
212
213 1 Warnings occurred and the locales were successfully created.
214
215 2 The locale specification exceeded implementation limits or the
216 coded character set or sets used were not supported by the
217 implementation, and no locale was created.
218
219 3 The capability to create new locales is not supported by the
220 implementation.
221
222 >3 Warnings or errors occurred and no output was created.
223
224
226 If an error is detected, no permanent output shall be created.
227
228 If warnings occur, permanent output shall be created if the -c option
229 was specified. The following conditions shall cause warning messages to
230 be issued:
231
232 * If a symbolic name not found in the charmap file is used for the
233 descriptions of the LC_CTYPE or LC_COLLATE categories (for other
234 categories, this shall be an error condition).
235
236 * If the number of operands to the order keyword exceeds the
237 {COLL_WEIGHTS_MAX} limit.
238
239 * If optional keywords not supported by the implementation are present
240 in the source.
241
242 * If a non-printable character has a width specified other than -1.
243
244 Other implementation-defined conditions may also cause warnings.
245
246 The following sections are informative.
247
249 The charmap definition is optional, and is contained outside the locale
250 definition. This allows both completely self-defined source files, and
251 generic sources (applicable to more than one codeset). To aid portabil‐
252 ity, all charmap definitions must use the same symbolic names for the
253 portable character set. As explained in the Base Definitions volume of
254 IEEE Std 1003.1-2001, Section 6.4, Character Set Description File, it
255 is implementation-defined whether or not users or applications can pro‐
256 vide additional character set description files. Therefore, the -f
257 option might be operable only when an implementation-defined charmap is
258 named.
259
261 None.
262
264 The output produced by the localedef utility is implementation-defined.
265 The name operand is used to identify the specific locale. (As a conse‐
266 quence, although several categories can be processed in one execution,
267 only categories belonging to the same locale can be processed.)
268
270 None.
271
273 locale , the Base Definitions volume of IEEE Std 1003.1-2001, Section
274 7.3, Locale Definition
275
277 Portions of this text are reprinted and reproduced in electronic form
278 from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
279 -- Portable Operating System Interface (POSIX), The Open Group Base
280 Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
281 Electrical and Electronics Engineers, Inc and The Open Group. In the
282 event of any discrepancy between this version and the original IEEE and
283 The Open Group Standard, the original IEEE and The Open Group Standard
284 is the referee document. The original Standard can be obtained online
285 at http://www.opengroup.org/unix/online.html .
286
287
288
289IEEE/The Open Group 2003 LOCALEDEF(P)