1LOCALEDEF(1P)              POSIX Programmer's Manual             LOCALEDEF(1P)
2
3
4

PROLOG

6       This  manual  page is part of the POSIX Programmer's Manual.  The Linux
7       implementation of this interface may differ (consult the  corresponding
8       Linux  manual page for details of Linux behavior), or the interface may
9       not be implemented on Linux.
10

NAME

12       localedef — define locale environment
13

SYNOPSIS

15       localedef [-c] [-f charmap] [-i sourcefile] [-u code_set_name] name
16

DESCRIPTION

18       The localedef utility shall convert source definitions for locale cate‐
19       gories into a format usable by the functions and utilities whose opera‐
20       tional behavior is determined by the setting of the locale  environment
21       variables defined in the Base Definitions volume of POSIX.1‐2017, Chap‐
22       ter 7, Locale.  It is implementation-defined  whether  users  have  the
23       capability  to create new locales, in addition to those supplied by the
24       implementation. If the symbolic constant POSIX2_LOCALEDEF  is  defined,
25       the  system  supports  the  creation of new locales.  On XSI-conformant
26       systems, the symbolic constant POSIX2_LOCALEDEF shall be defined.
27
28       The utility shall read source definitions for one or more locale  cate‐
29       gories  belonging  to  the  same  locale  from the file named in the -i
30       option (if specified) or from standard input.
31
32       The name operand identifies the target locale. The utility  shall  sup‐
33       port  the  creation of public, or generally accessible locales, as well
34       as private, or restricted-access locales. Implementations may  restrict
35       the  capability to create or modify public locales to users with appro‐
36       priate privileges.
37
38       Each category source definition shall be identified by the  correspond‐
39       ing  environment  variable  name and terminated by an END category-name
40       statement. The following categories shall be  supported.  In  addition,
41       the input may contain source for implementation-defined categories.
42
43       LC_CTYPE  Defines character classification and case conversion.
44
45       LC_COLLATE
46                 Defines collation rules.
47
48       LC_MONETARY
49                 Defines the format and symbols used in formatting of monetary
50                 information.
51
52       LC_NUMERIC
53                 Defines the decimal delimiter, grouping, and grouping  symbol
54                 for non-monetary numeric editing.
55
56       LC_TIME   Defines the format and content of date and time information.
57
58       LC_MESSAGES
59                 Defines  the  format  and  values of affirmative and negative
60                 responses.
61

OPTIONS

63       The localedef utility shall conform to the Base Definitions  volume  of
64       POSIX.1‐2017, Section 12.2, Utility Syntax Guidelines.
65
66       The following options shall be supported:
67
68       -c        Create  permanent  output  even if warning messages have been
69                 issued.
70
71       -f charmap
72                 Specify the pathname of a file containing a mapping of  char‐
73                 acter symbols and collating element symbols to actual charac‐
74                 ter encodings.  The format of the charmap is described in the
75                 Base Definitions volume of POSIX.1‐2017, Section 6.4, Charac‐
76                 ter Set Description File.  The application shall ensure  that
77                 this  option  is specified if symbolic names (other than col‐
78                 lating symbols defined in  a  collating-symbol  keyword)  are
79                 used.  If  the  -f  option is not present, an implementation-
80                 defined character mapping shall be used.
81
82       -i inputfile
83                 The pathname of a file containing the source definitions.  If
84                 this  option is not present, source definitions shall be read
85                 from standard input. The format of the inputfile is described
86                 in  the Base Definitions volume of POSIX.1‐2017, Section 7.3,
87                 Locale Definition.
88
89       -u code_set_name
90                 Specify the name of a codeset used as the target  mapping  of
91                 character  symbols and collating element symbols whose encod‐
92                 ing values are defined in terms of  the  ISO/IEC 10646‐1:2000
93                 standard position constant values.
94

OPERANDS

96       The following operand shall be supported:
97
98       name      Identifies  the  locale;  see  the Base Definitions volume of
99                 POSIX.1‐2017, Chapter 7, Locale for a description of the  use
100                 of  this name. If the name contains one or more <slash> char‐
101                 acters, name shall be interpreted as  a  pathname  where  the
102                 created  locale definitions shall be stored. If name does not
103                 contain any <slash> characters,  the  interpretation  of  the
104                 name  is  implementation-defined and the locale shall be pub‐
105                 lic. The ability to create public locales in this way may  be
106                 restricted to users with appropriate privileges. (As a conse‐
107                 quence of specifying one name,  although  several  categories
108                 can  be processed in one execution, only categories belonging
109                 to the same locale can be processed.)
110

STDIN

112       Unless the -i option is specified, the standard input shall be  a  text
113       file  containing  one  or  more  locale category source definitions, as
114       described in the Base Definitions volume of POSIX.1‐2017, Section  7.3,
115       Locale Definition.  When lines are continued using the escape character
116       mechanism, there is no limit to the length of the accumulated continued
117       line.
118

INPUT FILES

120       The character set mapping file specified as the charmap option-argument
121       is described in the Base Definitions volume  of  POSIX.1‐2017,  Section
122       6.4, Character Set Description File.  If a locale category source defi‐
123       nition contains a copy statement, as defined in  the  Base  Definitions
124       volume of POSIX.1‐2017, Chapter 7, Locale, and the copy statement names
125       a valid, existing locale, then localedef shall behave as if the  source
126       definition  had  contained  a  valid category source definition for the
127       named locale.
128

ENVIRONMENT VARIABLES

130       The following environment  variables  shall  affect  the  execution  of
131       localedef:
132
133       LANG      Provide  a  default  value for the internationalization vari‐
134                 ables that are unset or null. (See the Base Definitions  vol‐
135                 ume  of POSIX.1‐2017, Section 8.2, Internationalization Vari‐
136                 ables for the precedence  of  internationalization  variables
137                 used to determine the values of locale categories.)
138
139       LC_ALL    If  set  to  a non-empty string value, override the values of
140                 all the other internationalization variables.
141
142       LC_COLLATE
143                 (This variable has no affect on localedef; the  POSIX  locale
144                 is used for this category.)
145
146       LC_CTYPE  Determine  the  locale for the interpretation of sequences of
147                 bytes of text data as characters (for example, single-byte as
148                 opposed  to  multi-byte  characters  in  arguments  and input
149                 files). This variable has no  affect  on  the  processing  of
150                 localedef  input data; the POSIX locale is used for this pur‐
151                 pose, regardless of the value of this variable.
152
153       LC_MESSAGES
154                 Determine the locale that should be used to affect the format
155                 and  contents  of  diagnostic  messages  written  to standard
156                 error.
157
158       NLSPATH   Determine the location of message catalogs for the processing
159                 of LC_MESSAGES.
160

ASYNCHRONOUS EVENTS

162       Default.
163

STDOUT

165       The  utility  shall report all categories successfully processed, in an
166       unspecified format.
167

STDERR

169       The standard error shall be used only for diagnostic messages.
170

OUTPUT FILES

172       The format of the created output is unspecified. If  the  name  operand
173       does  not  contain  a  <slash>, the existence of an output file for the
174       locale is unspecified.
175

EXTENDED DESCRIPTION

177       When the -u option is used, the code_set_name option-argument shall  be
178       interpreted as an implementation-defined name of a codeset to which the
179       ISO/IEC 10646‐1:2000 standard position constant values  shall  be  con‐
180       verted    via    an    implementation-defined    method.    Both    the
181       ISO/IEC 10646‐1:2000 standard position constant values and  other  for‐
182       mats (decimal, hexadecimal, or octal) shall be valid as encoding values
183       within the charmap file. The codeset represented by the implementation-
184       defined  name  can  be any codeset that is supported by the implementa‐
185       tion.
186
187       When   conflicts   occur   between   the   charmap   specification   of
188       <code_set_name>,  <mb_cur_max>, or <mb_cur_min> and the implementation-
189       defined interpretation of these respective items for the codeset repre‐
190       sented  by the -u option-argument code_set_name, the result is unspeci‐
191       fied.
192
193       When conflicts occur between the charmap encoding values specified  for
194       symbolic  names  of  characters  of  the portable character set and the
195       implementation-defined assignment of  character  encoding  values,  the
196       result is unspecified.
197
198       If  a non-printable character in the charmap has a width specified that
199       is not -1, the result will be undefined.
200

EXIT STATUS

202       The following exit values shall be returned:
203
204        0    No errors occurred and the locales were successfully created.
205
206        1    Warnings occurred and the locales were successfully created.
207
208        2    The locale specification exceeded implementation  limits  or  the
209             coded character set or sets used were not supported by the imple‐
210             mentation, and no locale was created.
211
212        3    The capability to create new locales  is  not  supported  by  the
213             implementation.
214
215       >3    Warnings or errors occurred and no output was created.
216

CONSEQUENCES OF ERRORS

218       If an error is detected, no permanent output shall be created.
219
220       If  warnings  occur, permanent output shall be created if the -c option
221       was specified. The following conditions shall cause warning messages to
222       be issued:
223
224        *  If  a  symbolic  name not found in the charmap file is used for the
225           descriptions of the LC_CTYPE or LC_COLLATE  categories  (for  other
226           categories, this shall be an error condition).
227
228        *  If  the  number  of  operands  to  the  order  keyword  exceeds the
229           {COLL_WEIGHTS_MAX} limit.
230
231        *  If optional  keywords  not  supported  by  the  implementation  are
232           present in the source.
233
234       Other implementation-defined conditions may also cause warnings.
235
236       The following sections are informative.
237

APPLICATION USAGE

239       The charmap definition is optional, and is contained outside the locale
240       definition. This allows both completely self-defined source files,  and
241       generic sources (applicable to more than one codeset). To aid portabil‐
242       ity, all charmap definitions must use the same symbolic names  for  the
243       portable  character set. As explained in the Base Definitions volume of
244       POSIX.1‐2017, Section 6.4, Character Set Description File, it is imple‐
245       mentation-defined  whether  or  not  users  or applications can provide
246       additional character set description files. Therefore,  the  -f  option
247       might be operable only when an implementation-defined charmap is named.
248

EXAMPLES

250       None.
251

RATIONALE

253       The output produced by the localedef utility is implementation-defined.
254       The name operand is used to identify the specific locale. (As a  conse‐
255       quence,  although several categories can be processed in one execution,
256       only categories belonging to the same locale can be processed.)
257

FUTURE DIRECTIONS

259       None.
260

SEE ALSO

262       locale
263
264       The Base Definitions volume of POSIX.1‐2017, Section 6.4, Character Set
265       Description  File, Chapter 7, Locale, Chapter 8, Environment Variables,
266       Section 12.2, Utility Syntax Guidelines
267
269       Portions of this text are reprinted and reproduced in  electronic  form
270       from  IEEE Std 1003.1-2017, Standard for Information Technology -- Por‐
271       table Operating System Interface (POSIX), The Open Group Base  Specifi‐
272       cations  Issue  7, 2018 Edition, Copyright (C) 2018 by the Institute of
273       Electrical and Electronics Engineers, Inc and The Open Group.   In  the
274       event of any discrepancy between this version and the original IEEE and
275       The Open Group Standard, the original IEEE and The Open Group  Standard
276       is  the  referee document. The original Standard can be obtained online
277       at http://www.opengroup.org/unix/online.html .
278
279       Any typographical or formatting errors that appear  in  this  page  are
280       most likely to have been introduced during the conversion of the source
281       files to man page format. To report such errors,  see  https://www.ker
282       nel.org/doc/man-pages/reporting_bugs.html .
283
284
285
286IEEE/The Open Group                  2017                        LOCALEDEF(1P)
Impressum