Merge branch 'vendor/GCC47'
[dragonfly.git] / usr.bin / mklocale / mklocale.1
1 .\" $NetBSD: src/usr.bin/mklocale/mklocale.1,v 1.13 2004/01/24 17:03:26 wiz Exp $
2 .\" FreeBSD: src/usr.bin/mklocale/mklocale.1,v 1.6 1999/09/20 09:15:21 phantom Exp
3 .\" $DragonFly: src/usr.bin/mklocale/mklocale.1,v 1.7 2007/07/29 17:27:45 swildner Exp $
4 .\"
5 .\" Copyright (c) 1993, 1994
6 .\"     The Regents of the University of California.  All rights reserved.
7 .\"
8 .\" This code is derived from software contributed to Berkeley by
9 .\" Paul Borman at Krystal Technologies.
10 .\"
11 .\" Redistribution and use in source and binary forms, with or without
12 .\" modification, are permitted provided that the following conditions
13 .\" are met:
14 .\" 1. Redistributions of source code must retain the above copyright
15 .\"    notice, this list of conditions and the following disclaimer.
16 .\" 2. Redistributions in binary form must reproduce the above copyright
17 .\"    notice, this list of conditions and the following disclaimer in the
18 .\"    documentation and/or other materials provided with the distribution.
19 .\" 3. Neither the name of the University nor the names of its contributors
20 .\"    may be used to endorse or promote products derived from this software
21 .\"    without specific prior written permission.
22 .\"
23 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 .\" SUCH DAMAGE.
34 .\"
35 .\"     @(#)mklocale.1  8.2 (Berkeley) 4/18/94
36 .\"
37 .Dd April 18, 1994
38 .Dt MKLOCALE 1
39 .Os
40 .Sh NAME
41 .Nm mklocale
42 .Nd make LC_CTYPE locale files
43 .Sh SYNOPSIS
44 .Nm
45 .Op Fl d
46 .Ar \& Ns Ao src-file
47 .Ar \& Ac Ns language/LC_CTYPE
48 .Nm
49 .Op Fl d
50 .Fl o
51 .Ar language/LC_CTYPE
52 .Ar src-file
53 .Sh DESCRIPTION
54 The
55 .Nm
56 utility reads an
57 .Dv LC_CTYPE
58 source file from standard input and produces an
59 .Dv LC_CTYPE
60 binary file on standard output suitable for placement in
61 .Pa /usr/share/locale/ Ns Ar language Ns Pa /LC_CTYPE .
62 .Pp
63 The format of
64 .Ar src-file
65 is quite simple.
66 It consists of a series of lines which start with a keyword and have
67 associated data following.
68 C style comments are used
69 to place comments in the file.
70 .Pp
71 Following options are available:
72 .Bl -tag -width XXX
73 .It Fl d
74 Turns on debugging messages.
75 .It Fl o
76 Specify output file.
77 .El
78 .Pp
79 Besides the keywords which will be listed below,
80 the following are valid tokens in
81 .Ar src-file :
82 .Bl -tag -width literal
83 .It Dv RUNE
84 A
85 .Dv RUNE
86 may be any of the following:
87 .Bl -tag -width 0x[0-9a-z]*
88 .It Ar 'x'
89 The ASCII character
90 .Ar x .
91 .It Ar '\ex'
92 The ANSI C character
93 .Ar \ex
94 where
95 .Ar \ex
96 is one of
97 .Dv \ea ,
98 .Dv \eb ,
99 .Dv \ef ,
100 .Dv \en ,
101 .Dv \er ,
102 .Dv \et ,
103 or
104 .Dv \ev .
105 .It Ar 0x[0-9a-z]*
106 A hexadecimal number representing a rune code.
107 .It Ar 0[0-7]*
108 An octal number representing a rune code.
109 .It Ar [1-9][0-9]*
110 A decimal number representing a rune code.
111 .El
112 .It Dv STRING
113 A string enclosed in double quotes (").
114 .It Dv THRU
115 Either
116 .Dv ...
117 or
118 .Dv - .
119 Used to indicate ranges.
120 .It Ar literal
121 The follow characters are taken literally:
122 .Bl -tag -width "\*[Lt]\|\|(\|\|["
123 .It Dv "\*[Lt]\|(\|["
124 Used to start a mapping.
125 All are equivalent.
126 .It Dv "\*[Gt]\|\^)\|]"
127 Used to end a mapping.
128 All are equivalent.
129 .It Dv :
130 Used as a delimiter in mappings.
131 .El
132 .El
133 .Pp
134 Key words which should only appear once are:
135 .Bl -tag -width PHONOGRAM
136 .It Dv ENCODING
137 Followed by a
138 .Dv STRING
139 which indicates the encoding mechanism to be used for this locale.
140 The current encodings are:
141 .Bl -tag -width NONE
142 .It Dv NONE
143 No translation and the default.
144 .It Dv UTF2
145 .Dv "Universal character set Transformation Format"
146 adopted from
147 .Nm "Plan 9 from Bell Labs" .
148 .It Dv EUC
149 .Dv EUC
150 encoding as used by several
151 vendors of
152 .Ux
153 systems.
154 .El
155 .It Dv VARIABLE
156 This keyword must be followed by a single tab or space character,
157 after which encoding specific data is placed.
158 Currently only the
159 .Dv "EUC"
160 encoding requires variable data.
161 See
162 .Xr euc 5
163 for further details.
164 .It Dv INVALID
165 A single
166 .Dv RUNE
167 .El
168 .Pp
169 The following keywords may appear multiple times and have the following
170 format for data:
171 .in +.5i
172 .Bl -tag -width "XXRUNE1 THRU RUNEn : RUNE2XX"
173 .It Aq Dv RUNE1 RUNE2
174 .Dv RUNE1
175 is mapped to
176 .Dv RUNE2 .
177 .It Aq Dv RUNE1 THRU RUNEn : RUNE2
178 Runes
179 .Dv RUNE1
180 through
181 .Dv RUNEn
182 are mapped to
183 .Dv RUNE2
184 through
185 .Dv RUNE2
186 + n-1.
187 .El
188 .in -.5i
189 .Bl -tag -width PHONOGRAM
190 .It Dv MAPLOWER
191 Defines the tolower mappings.
192 .Dv RUNE2
193 is the lower case representation of
194 .Dv RUNE1 .
195 .It Dv MAPUPPER
196 Defines the toupper mappings.
197 .Dv RUNE2
198 is the upper case representation of
199 .Dv RUNE1 .
200 .It Dv TODIGIT
201 Defines a map from runes to their digit value.
202 .Dv RUNE2
203 is the integer value represented by
204 .Dv RUNE1 .
205 For example, the ASCII character
206 .Sq 0
207 would map to the decimal value 0.
208 Only values up to 255 are allowed.
209 .El
210 .Pp
211 The following keywords may appear multiple times and have the following
212 format for data:
213 .Bl -tag -width "RUNE1 THRU RUNEn"
214 .It Dv RUNE
215 This rune has the property defined by the keyword.
216 .It Dv "RUNE1 THRU RUNEn"
217 All the runes between and including
218 .Dv RUNE1
219 and
220 .Dv RUNEn
221 have the property defined by the keyword.
222 .El
223 .Bl -tag -width PHONOGRAM
224 .It Dv ALPHA
225 Defines runes which are alphabetic, printable, and graphic.
226 .It Dv CONTROL
227 Defines runes which are control characters.
228 .It Dv DIGIT
229 Defines runes which are decimal digits, printable, and graphic.
230 .It Dv GRAPH
231 Defines runes which are graphic and printable.
232 .It Dv LOWER
233 Defines runes which are lower case, printable, and graphic.
234 .It Dv PUNCT
235 Defines runes which are punctuation, printable, and graphic.
236 .It Dv SPACE
237 Defines runes which are spaces.
238 .It Dv UPPER
239 Defines runes which are upper case, printable, and graphic.
240 .It Dv XDIGIT
241 Defines runes which are hexadecimal digits, printable, and graphic.
242 .It Dv BLANK
243 Defines runes which are blank.
244 .It Dv PRINT
245 Defines runes which are printable.
246 .It Dv IDEOGRAM
247 Defines runes which are ideograms, printable, and graphic.
248 .It Dv SPECIAL
249 Defines runes which are special characters, printable, and graphic.
250 .It Dv PHONOGRAM
251 Defines runes which are phonograms, printable, and graphic.
252 .It Dv SWIDTHn
253 Defines runes with specific glyph width.
254 .Ar n
255 takes 0 to 3.
256 .It Dv CHARSET
257 Controls character set for subsequent runes.
258 .\" To support
259 .\" .Xr iso2022 4
260 .\" locale definitions.
261 .El
262 .Sh SEE ALSO
263 .Xr colldef 1 ,
264 .Xr setlocale 3 ,
265 .Xr euc 5 ,
266 .Xr utf8 5 ,
267 .Xr nls 7
268 .Sh HISTORY
269 The
270 .Nm
271 utility first appeared in
272 .Bx 4.4 .
273 .Sh BUGS
274 The
275 .Nm
276 utility is overly simplistic.
277 .Pp
278 We should switch to
279 .Nm localedef
280 and its file format, which is more standard.