Adjust man page sections.
[dragonfly.git] / usr.bin / mklocale / mklocale.1
1 .\" Copyright (c) 1993, 1994
2 .\"     The Regents of the University of California.  All rights reserved.
3 .\"
4 .\" This code is derived from software contributed to Berkeley by
5 .\" Paul Borman at Krystal Technologies.
6 .\"
7 .\" Redistribution and use in source and binary forms, with or without
8 .\" modification, are permitted provided that the following conditions
9 .\" are met:
10 .\" 1. Redistributions of source code must retain the above copyright
11 .\"    notice, this list of conditions and the following disclaimer.
12 .\" 2. Redistributions in binary form must reproduce the above copyright
13 .\"    notice, this list of conditions and the following disclaimer in the
14 .\"    documentation and/or other materials provided with the distribution.
15 .\" 3. All advertising materials mentioning features or use of this software
16 .\"    must display the following acknowledgement:
17 .\"     This product includes software developed by the University of
18 .\"     California, Berkeley and its contributors.
19 .\" 4. 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 .\" $FreeBSD: src/usr.bin/mklocale/mklocale.1,v 1.7.2.5 2003/02/24 23:04:39 trhodes Exp $
37 .\" $DragonFly: src/usr.bin/mklocale/mklocale.1,v 1.4 2005/03/24 12:48:04 swildner Exp $
38 .\"
39 .Dd August 21, 2004
40 .Dt MKLOCALE 1
41 .Os
42 .Sh NAME
43 .Nm mklocale
44 .Nd make LC_CTYPE locale files
45 .Sh SYNOPSIS
46 .Nm
47 .Op Fl d
48 .Ar "< src-file"
49 .Ar "> language/LC_CTYPE"
50 .Nm
51 .Op Fl d
52 .Fl o
53 .Ar language/LC_CTYPE
54 .Ar src-file
55 .Sh DESCRIPTION
56 The
57 .Nm
58 utility reads a
59 .Dv LC_CTYPE
60 source file from standard input and produces a
61 .Dv LC_CTYPE
62 binary file on standard output suitable for placement in
63 .Pa /usr/share/locale/ Ns Ar language Ns Pa /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.  C style comments are used
70 to place comments in the file.
71 .Pp
72 Following options are available:
73 .Bl -tag -width indent
74 .It Fl d
75 Turns on debugging messages.
76 .It Fl o
77 Specify output file.
78 .El
79 .Pp
80 Besides the keywords which will be listed below,
81 the following are valid tokens in
82 .Ar src-file :
83 .Bl -tag -width ".Ar literal"
84 .It Dv RUNE
85 A
86 .Dv RUNE
87 may be any of the following:
88 .Bl -tag -width ".Ar 0x[0-9a-z]*"
89 .It Ar 'x'
90 The ASCII character
91 .Ar x .
92 .It Ar '\ex'
93 The ANSI C character
94 .Ar \ex
95 where
96 .Ar \ex
97 is one of
98 .Dv \ea ,
99 .Dv \eb ,
100 .Dv \ef ,
101 .Dv \en ,
102 .Dv \er ,
103 .Dv \et ,
104 or
105 .Dv \ev .
106 .It Ar 0x[0-9a-z]*
107 A hexadecimal number representing a rune code.
108 .It Ar 0[0-7]*
109 An octal number representing a rune code.
110 .It Ar [1-9][0-9]*
111 A decimal number representing a rune code.
112 .El
113 .It Dv STRING
114 A string enclosed in double quotes (").
115 .It Dv THRU
116 Either
117 .Dv ...
118 or
119 .Dv - .
120 Used to indicate ranges.
121 .It Ar literal
122 The follow characters are taken literally:
123 .Bl -tag -width ".Dv <\|\|(\|\|["
124 .It Dv "<\|(\|["
125 Used to start a mapping.  All are equivalent.
126 .It Dv ">\|\^)\|]"
127 Used to end a mapping.  All are equivalent.
128 .It Dv :
129 Used as a delimiter in mappings.
130 .El
131 .El
132 .Pp
133 Key words which should only appear once are:
134 .Bl -tag -width PHONOGRAM
135 .It Dv ENCODING
136 Followed by a
137 .Dv STRING
138 which indicates the encoding mechanism to be used for this locale.
139 The current encodings are:
140 .Bl -tag -width NONE
141 .It Dv NONE
142 No translation and the default.
143 .It Dv UTF2
144 .Dv "Universal character set Transformation Format"
145 adopted from
146 .Tn "Plan 9 from Bell Labs" .
147 This is the preferred encoding.
148 .It Dv EUC
149 .Dv EUC
150 encoding as used by several
151 vendors of
152 .Ux
153 systems.
154 .It Dv GB18030
155 PRC national standard for encoding of Chinese text.
156 .It Dv GB2312
157 Older PRC national standard for encoding Chinese text.
158 .It Dv GBK
159 A widely used encoding method for Chinese text,
160 backwards compatible with GB\ 2312-1980.
161 .It Dv MSKanji
162 The method of encoding Japanese used by Microsoft,
163 loosely based on JIS.
164 Also known as
165 .Dq "Shift JIS"
166 and
167 .Dq SJIS .
168 .It Dv NONE
169 No translation and the default.
170 .It Dv UTF2
171 (obsolete)
172 .Dq "Universal character set Transformation Format"
173 adopted from
174 .Tn "Plan 9 from Bell Labs" .
175 .It Dv UTF-8
176 The
177 .Dv UTF-8
178 transformation format of
179 .Tn ISO
180 10646
181 as defined by RFC 2279.
182 .El
183 .It Dv VARIABLE
184 This keyword must be followed by a single tab or space character,
185 after which encoding specific data is placed.
186 Currently only the
187 .Dv "EUC"
188 encoding requires variable data.
189 See
190 .Xr euc 5
191 for further details.
192 .El
193 .Pp
194 The following keywords may appear multiple times and have the following
195 format for data:
196 .Bl -tag -width ".Dv <RUNE1 THRU RUNEn : RUNE2>" -offset indent
197 .It Dv <RUNE1 RUNE2>
198 .Dv RUNE1
199 is mapped to
200 .Dv RUNE2 .
201 .It Dv <RUNE1 THRU RUNEn : RUNE2>
202 Runes
203 .Dv RUNE1
204 through
205 .Dv RUNEn
206 are mapped to
207 .Dv RUNE2
208 through
209 .Dv RUNE2
210 + n-1.
211 .El
212 .Bl -tag -width ".Dv PHONOGRAM"
213 .It Dv MAPLOWER
214 Defines the tolower mappings.
215 .Dv RUNE2
216 is the lower case representation of
217 .Dv RUNE1 .
218 .It Dv MAPUPPER
219 Defines the toupper mappings.
220 .Dv RUNE2
221 is the upper case representation of
222 .Dv RUNE1 .
223 .It Dv TODIGIT
224 Defines a map from runes to their digit value.
225 .Dv RUNE2
226 is the integer value represented  by
227 .Dv RUNE1 .
228 For example, the ASCII character
229 .Ql 0
230 would map to the decimal value 0.
231 Only values up to 255
232 are allowed.
233 .El
234 .Pp
235 The following keywords may appear multiple times and have the following
236 format for data:
237 .Bl -tag -width ".Dv RUNE1 THRU RUNEn" -offset indent
238 .It Dv RUNE
239 This rune has the property defined by the keyword.
240 .It Dv "RUNE1 THRU RUNEn"
241 All the runes between and including
242 .Dv RUNE1
243 and
244 .Dv RUNEn
245 have the property defined by the keyword.
246 .El
247 .Bl -tag -width ".Dv PHONOGRAM"
248 .It Dv ALPHA
249 Defines runes which are alphabetic, printable and graphic.
250 .It Dv CONTROL
251 Defines runes which are control characters.
252 .It Dv DIGIT
253 Defines runes which are decimal digits, printable and graphic.
254 .It Dv GRAPH
255 Defines runes which are graphic and printable.
256 .It Dv LOWER
257 Defines runes which are lower case, printable and graphic.
258 .It Dv PUNCT
259 Defines runes which are punctuation, printable and graphic.
260 .It Dv SPACE
261 Defines runes which are spaces.
262 .It Dv UPPER
263 Defines runes which are upper case, printable and graphic.
264 .It Dv XDIGIT
265 Defines runes which are hexadecimal digits, printable and graphic.
266 .It Dv BLANK
267 Defines runes which are blank.
268 .It Dv PRINT
269 Defines runes which are printable.
270 .It Dv IDEOGRAM
271 Defines runes which are ideograms, printable and graphic.
272 .It Dv SPECIAL
273 Defines runes which are special characters, printable and graphic.
274 .It Dv PHONOGRAM
275 Defines runes which are phonograms, printable and graphic.
276 .It Dv SWIDTH0
277 Defines runes with display width 0.
278 .It Dv SWIDTH1
279 Defines runes with display width 1.
280 .It Dv SWIDTH2
281 Defines runes with display width 2.
282 .It Dv SWIDTH3
283 Defines runes with display width 3.
284 .El
285 .Pp
286 If no display width explicitly defined, width 1 assumed
287 for printable runes by default.
288 .Sh SEE ALSO
289 .Xr colldef 1 ,
290 .Xr setlocale 3 ,
291 .Xr wcwidth 3 ,
292 .Xr big5 5 ,
293 .Xr euc 5 ,
294 .Xr gb18030 5 ,
295 .Xr gb2312 5 ,
296 .Xr gbk 5 ,
297 .Xr mskanji 5 ,
298 .Xr utf8 5
299 .Sh BUGS
300 The
301 .Nm
302 utility is overly simplistic.
303 .Sh HISTORY
304 The
305 .Nm
306 utility first appeared in
307 .Bx 4.4 .