Complete Citrus import. Import message catalog implement from
[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.5 2005/04/21 16:36:35 joerg 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 mklocale
45 .Op Fl d
46 \*[Lt]
47 .Ar src-file
48 \*[Gt]
49 .Ar language/LC_CTYPE
50 .Nm mklocale
51 .Op Fl d
52 .Fl o
53 .Ar language/LC_CTYPE
54 .Ar src-file
55 .Sh DESCRIPTION
56 The
57 .Nm mklocale
58 utility reads an
59 .Dv LC_CTYPE
60 source file from standard input and produces an
61 .Dv LC_CTYPE
62 binary file on standard output suitable for placement in
63 .Pa /usr/share/locale/\*[Lt]language\*[Gt]/LC_CTYPE .
64 .Pp
65 The format of
66 .Ar src-file
67 is quite simple.
68 It consists of a series of lines which start with a keyword and have
69 associated data following.
70 C style comments are used
71 to place comments in the file.
72 .Pp
73 Following options are available:
74 .Bl -tag -width XXX
75 .It Fl d
76 Turns on debugging messages.
77 .It Fl o
78 Specify output file.
79 .El
80 .Pp
81 Besides the keywords which will be listed below,
82 the following are valid tokens in
83 .Ar src-file :
84 .Bl -tag -width literal
85 .It Dv RUNE
86 A
87 .Dv RUNE
88 may be any of the following:
89 .Bl -tag -width 0x[0-9a-z]*
90 .It Ar 'x'
91 The ASCII character
92 .Ar x .
93 .It Ar '\ex'
94 The ANSI C character
95 .Ar \ex
96 where
97 .Ar \ex
98 is one of
99 .Dv \ea ,
100 .Dv \eb ,
101 .Dv \ef ,
102 .Dv \en ,
103 .Dv \er ,
104 .Dv \et ,
105 or
106 .Dv \ev .
107 .It Ar 0x[0-9a-z]*
108 A hexadecimal number representing a rune code.
109 .It Ar 0[0-7]*
110 An octal number representing a rune code.
111 .It Ar [1-9][0-9]*
112 A decimal number representing a rune code.
113 .El
114 .It Dv STRING
115 A string enclosed in double quotes (").
116 .It Dv THRU
117 Either
118 .Dv ...
119 or
120 .Dv - .
121 Used to indicate ranges.
122 .It Ar literal
123 The follow characters are taken literally:
124 .Bl -tag -width "\*[Lt]\|\|(\|\|["
125 .It Dv "\*[Lt]\|(\|["
126 Used to start a mapping.
127 All are equivalent.
128 .It Dv "\*[Gt]\|\^)\|]"
129 Used to end a mapping.
130 All are equivalent.
131 .It Dv :
132 Used as a delimiter in mappings.
133 .El
134 .El
135 .Pp
136 Key words which should only appear once are:
137 .Bl -tag -width PHONOGRAM
138 .It Dv ENCODING
139 Followed by a
140 .Dv STRING
141 which indicates the encoding mechanism to be used for this locale.
142 The current encodings are:
143 .Bl -tag -width NONE
144 .It Dv NONE
145 No translation and the default.
146 .It Dv UTF2
147 .Dv "Universal character set Transformation Format"
148 adopted from
149 .Nm "Plan 9 from Bell Labs" .
150 .It Dv EUC
151 .Dv EUC
152 encoding as used by several
153 vendors of
154 .Ux
155 systems.
156 .El
157 .It Dv VARIABLE
158 This keyword must be followed by a single tab or space character,
159 after which encoding specific data is placed.
160 Currently only the
161 .Dv "EUC"
162 encoding requires variable data.
163 See
164 .Xr euc 5
165 for further details.
166 .It Dv INVALID
167 A single
168 .Dv RUNE
169 .El
170 .Pp
171 The following keywords may appear multiple times and have the following
172 format for data:
173 .in +.5i
174 .Bl -tag -width "XXRUNE1 THRU RUNEn : RUNE2XX"
175 .It Aq Dv RUNE1 RUNE2
176 .Dv RUNE1
177 is mapped to
178 .Dv RUNE2 .
179 .It Aq Dv RUNE1 THRU RUNEn : RUNE2
180 Runes
181 .Dv RUNE1
182 through
183 .Dv RUNEn
184 are mapped to
185 .Dv RUNE2
186 through
187 .Dv RUNE2
188 + n-1.
189 .El
190 .in -.5i
191 .Bl -tag -width PHONOGRAM
192 .It Dv MAPLOWER
193 Defines the tolower mappings.
194 .Dv RUNE2
195 is the lower case representation of
196 .Dv RUNE1 .
197 .It Dv MAPUPPER
198 Defines the toupper mappings.
199 .Dv RUNE2
200 is the upper case representation of
201 .Dv RUNE1 .
202 .It Dv TODIGIT
203 Defines a map from runes to their digit value.
204 .Dv RUNE2
205 is the integer value represented by
206 .Dv RUNE1 .
207 For example, the ASCII character
208 .Sq 0
209 would map to the decimal value 0.
210 Only values up to 255 are allowed.
211 .El
212 .Pp
213 The following keywords may appear multiple times and have the following
214 format for data:
215 .Bl -tag -width "RUNE1 THRU RUNEn"
216 .It Dv RUNE
217 This rune has the property defined by the keyword.
218 .It Dv "RUNE1 THRU RUNEn"
219 All the runes between and including
220 .Dv RUNE1
221 and
222 .Dv RUNEn
223 have the property defined by the keyword.
224 .El
225 .Bl -tag -width PHONOGRAM
226 .It Dv ALPHA
227 Defines runes which are alphabetic, printable, and graphic.
228 .It Dv CONTROL
229 Defines runes which are control characters.
230 .It Dv DIGIT
231 Defines runes which are decimal digits, printable, and graphic.
232 .It Dv GRAPH
233 Defines runes which are graphic and printable.
234 .It Dv LOWER
235 Defines runes which are lower case, printable, and graphic.
236 .It Dv PUNCT
237 Defines runes which are punctuation, printable, and graphic.
238 .It Dv SPACE
239 Defines runes which are spaces.
240 .It Dv UPPER
241 Defines runes which are upper case, printable, and graphic.
242 .It Dv XDIGIT
243 Defines runes which are hexadecimal digits, printable, and graphic.
244 .It Dv BLANK
245 Defines runes which are blank.
246 .It Dv PRINT
247 Defines runes which are printable.
248 .It Dv IDEOGRAM
249 Defines runes which are ideograms, printable, and graphic.
250 .It Dv SPECIAL
251 Defines runes which are special characters, printable, and graphic.
252 .It Dv PHONOGRAM
253 Defines runes which are phonograms, printable, and graphic.
254 .It Dv SWIDTHn
255 Defines runes with specific glyph width.
256 .Ar n
257 takes 0 to 3.
258 .It Dv CHARSET
259 Controls character set for subsequent runes.
260 .\" To support
261 .\" .Xr iso2022 4
262 .\" locale definitions.
263 .El
264 .Sh SEE ALSO
265 .\"Xr colldef 1 ,
266 .Xr setlocale 3 ,
267 .\" .Xr euc 4 ,
268 .\" .Xr utf8 4
269 .Xr nls 7
270 .Sh HISTORY
271 The
272 .Nm mklocale
273 utility first appeared in
274 .Bx 4.4 .
275 .Sh BUGS
276 The
277 .Nm mklocale
278 utility is overly simplistic.
279 .Pp
280 We should switch to
281 .Nm localedef
282 and its file format, which is more standard.