]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - usr.bin/localedef/localedef.1
Fix build with recent byacc.
[FreeBSD/FreeBSD.git] / usr.bin / localedef / localedef.1
1 .\" Copyright (c) 1992, X/Open Company Limited  All Rights Reserved
2 .\" Portions Copyright (c) 2003, Sun Microsystems, Inc.  All Rights Reserved
3 .\" Portions Copyright 2013 DEY Storage Systems, Inc.
4 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for
5 .\" permission to reproduce portions of its copyrighted documentation.
6 .\" Original documentation from The Open Group can be obtained online at
7 .\" http://www.opengroup.org/bookstore/.
8 .\" The Institute of Electrical and Electronics Engineers and The Open Group,
9 .\" have given us permission to reprint portions of their documentation. In
10 .\" the following statement, the phrase "this text" refers to portions of the
11 .\" system documentation. Portions of this text are reprinted and reproduced
12 .\" in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1,
13 .\" 2004 Edition, Standard for Information Technology -- Portable Operating
14 .\" System Interface (POSIX), The Open Group Base Specifications Issue 6,
15 .\" Copyright (C) 2001-2004 by the Institute of Electrical and Electronics
16 .\" Engineers, Inc and The Open Group. In the event of any discrepancy between
17 .\" these versions and the original IEEE and The Open Group Standard, the
18 .\" original IEEE and The Open Group Standard is the referee document. The
19 .\" original Standard can be obtained online at
20 .\" http://www.opengroup.org/unix/online.html.
21 .\"  This notice shall appear on any product containing this material.
22 .\" The contents of this file are subject to the terms of the Common
23 .\" Development and Distribution License (the "License").  You may not use
24 .\" this file except in compliance with the License.
25 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or
26 .\" http://www.opensolaris.org/os/licensing.  See the License for the specific
27 .\" language governing permissions and limitations under the License.
28 .\" When distributing Covered Code, include this CDDL HEADER in each file and
29 .\" include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable,
30 .\" add the following below this CDDL HEADER, with the fields enclosed by
31 .\" brackets "[]" replaced with your own identifying information:
32 .\" Portions Copyright [yyyy] [name of copyright owner]
33 .\"
34 .\" $FreeBSD$
35 .\"
36 .Dd October 18, 2018
37 .Dt LOCALEDEF 1
38 .Os
39 .Sh NAME
40 .Nm localedef
41 .Nd define locale environment
42 .Sh SYNOPSIS
43 .Nm
44 .Op Fl bcDlUv
45 .Op Fl f Ar charmap
46 .Op Fl i Ar sourcefile
47 .Op Fl u Ar codeset
48 .Op Fl w Ar widthfile
49 .Ar localename
50 .Sh DESCRIPTION
51 The
52 .Nm
53 utility converts source definitions for locale categories
54 into a format usable by the functions and utilities whose operational behavior
55 is determined by the setting of the locale environment variables; see
56 .Xr environ 7 .
57 .Pp
58 The utility reads source definitions for one or more locale categories
59 belonging to the same locale from the file named in the
60 .Fl i
61 option (if specified) or from standard input.
62 .Pp
63 Each category source definition is identified by the corresponding environment
64 variable name and terminated by an
65 .Sy END
66 .Em category-name
67 statement.
68 The following categories are supported:
69 .Bl -tag -width ".Ev LC_MONETARY"
70 .It Ev LC_CTYPE
71 Defines character classification and case conversion.
72 .It Ev LC_COLLATE
73 Defines collation rules.
74 .It Ev LC_MONETARY
75 Defines the format and symbols used in formatting of monetary information.
76 .It Ev LC_NUMERIC
77 Defines the decimal delimiter, grouping and grouping symbol for non-monetary
78 numeric editing.
79 .It Ev LC_TIME
80 Defines the format and content of date and time information.
81 .It Ev LC_MESSAGES
82 Defines the format and values of affirmative and negative responses.
83 .El
84 .Pp
85 The following options are supported:
86 .Bl -tag -width indent
87 .It Fl b
88 Use big-endian byte order for output.
89 .It Fl c
90 Creates permanent output even if warning messages have been issued.
91 .It Fl D
92 BSD-style
93 output.
94 Rather than the default of creating the
95 .Ar localename
96 directory and creating files like
97 .Pa LC_CTYPE ,
98 .Pa LC_COLLATE ,
99 etc.\& in that directory,
100 the output file names have the format
101 .Dq <localename>.<category>
102 and are dumped to the current directory.
103 .It Fl f Ar charmap
104 Specifies the pathname of a file containing a mapping of character symbols and
105 collating element symbols to actual character encodings.
106 This option must be specified if symbolic names (other than collating symbols
107 defined in a
108 .Sy collating-symbol
109 keyword) are used.
110 If the
111 .Fl f
112 option is not present, the default character mapping will be used.
113 .It Fl i Ar sourcefile
114 The path name of a file containing the source definitions.
115 If this option is not present, source definitions will be read from
116 standard input.
117 .It Fl l
118 Use little-endian byte order for output.
119 .It Fl u Ar codeset
120 Specifies the name of a codeset used as the target mapping of character symbols
121 and collating element symbols whose encoding values are defined in terms of the
122 ISO/IEC 10646-1:2000 standard position constant values.
123 See
124 .Sx NOTES .
125 .It Fl U
126 Ignore the presence of character symbols that have no matching character
127 definition.  This facilitates the use of a common locale definition file
128 to be used across multiple encodings, even when some symbols are not
129 present in a given encoding.
130 .It Fl v
131 Emit verbose debugging output on standard output.
132 .It Fl w Ar widthfile
133 The path name of the file containing character screen width definitions.
134 If not supplied, then default screen widths will be assumed, which will
135 generally not account for East Asian encodings requiring more than a single
136 character cell to display, nor for combining or accent marks that occupy
137 no additional screen width.
138 .El
139 .Pp
140 The following operands are required:
141 .Bl -tag -width ".Ar localename"
142 .It Ar localename
143 Identifies the locale.
144 If the name contains one or more slash characters,
145 .Ar localename
146 will be interpreted as a path name where the created locale
147 definitions will be stored.
148 This capability may be restricted to users with appropriate privileges.
149 (As a consequence of specifying one
150 .Ar localename ,
151 although several categories can be processed in one execution, only categories
152 belonging to the same locale can be processed.)
153 .El
154 .Sh OUTPUT
155 .Nm
156 creates a directory of files that represents the locale's data,
157 unless instructed otherwise by the
158 .Fl D (
159 BSD
160 output) option.
161 The contants of this directory should generally be copied into the
162 appropriate subdirectory of
163 .Pa /usr/share/locale
164 in order the definitions to be visible to programs linked with libc.
165 .Sh ENVIRONMENT
166 See
167 .Xr environ 7
168 for definitions of the following environment variables that affect the
169 execution of
170 .Nm :
171 .Ev LANG ,
172 .Ev LC_ALL ,
173 .Ev LC_COLLATE ,
174 .Ev LC_CTYPE ,
175 .Ev LC_MESSAGES ,
176 .Ev LC_MONETARY ,
177 .Ev LC_MUMERIC ,
178 .Ev LC_TIME ,
179 and
180 .Ev NLSPATH .
181 .Sh EXIT STATUS
182 The following exit values are returned:
183 .Bl -tag -width XX
184 .It 0
185 No errors occurred and the locales were successfully created.
186 .It 1
187 Warnings occurred and the locales were successfully created.
188 .It 2
189 The locale specification exceeded implementation limits or the coded character
190 set or sets used were not supported by the implementation, and no locale was
191 created.
192 .It >3
193 Warnings or errors occurred and no output was created.
194 .El
195 .Pp
196 If an error is detected, no permanent output will be created.
197 .Sh SEE ALSO
198 .Xr locale 1 ,
199 .Xr iconv_open 3 ,
200 .Xr nl_langinfo 3 ,
201 .Xr strftime 3 ,
202 .Xr environ 7
203 .Sh WARNINGS
204 If warnings occur, permanent output will be created if the
205 .Fl c
206 option was specified.
207 The following conditions will cause warning messages to be issued:
208 .Bl -bullet
209 .It
210 If a symbolic name not found in the
211 .Pa charmap
212 file is used for the descriptions of the
213 .Sy LC_CTYPE
214 or
215 .Sy LC_COLLATE
216 categories (for other categories, this will be an error condition).
217 .It
218 If optional keywords not supported by the implementation are present in the
219 source.
220 .El
221 .Sh NOTES
222 When the
223 .Fl u
224 option is used, the
225 .Ar codeset
226 option-argument is interpreted as a name of a codeset to which the
227 ISO/IEC 10646-1:2000 standard position constant values are converted.
228 Both the ISO/IEC 10646-1:2000 standard position constant values and
229 other formats (decimal, hexadecimal, or octal) are valid as encoding
230 values within the charmap file.
231 The
232 .Ar codeset
233 can be any codeset that is supported by the
234 .Fn iconv_open 3
235 function.
236 .Pp
237 When conflicts occur between the charmap specification of
238 .Ar codeset ,
239 .Em mb_cur_max ,
240 or
241 .Em mb_cur_min
242 and the corresponding value for the codeset represented by the
243 .Fl u
244 option-argument
245 .Ar codeset ,
246 the
247 .Nm
248 utility fails with an error.
249 .Pp
250 When conflicts occur between the charmap encoding values specified for symbolic
251 names of characters of the portable character set and the character encoding
252 values defined by the US-ASCII, the result is unspecified.
253 .Sh HISTORY
254 .Nm
255 first appeared in
256 .Fx 11 .
257 .Pp
258 It was written by
259 .An Garrett D'Amore
260 .Aq Mt garrett@nexenta.com
261 for Illumos.
262 .An John Marino
263 .Aq Mt draco@marino.st
264 provided the alternations necessary to compile cleanly on
265 .Dx .
266 .An Baptiste Daroussin
267 .Aq Mt bapt@FreeBSD.org
268 ported it to
269 .Fx
270 and converted it to
271 .Xr tree 3 .