usr.bin: fix more mandoc(1) warnings
[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 .Bl -tag -width "XXRUNE1 THRU RUNEn : RUNE2XX" -offset indent
172 .It Aq Dv RUNE1 RUNE2
173 .Dv RUNE1
174 is mapped to
175 .Dv RUNE2 .
176 .It Aq Dv RUNE1 THRU RUNEn : RUNE2
177 Runes
178 .Dv RUNE1
179 through
180 .Dv RUNEn
181 are mapped to
182 .Dv RUNE2
183 through
184 .Dv RUNE2
185 + n\-1.
186 .El
187 .Bl -tag -width PHONOGRAM
188 .It Dv MAPLOWER
189 Defines the tolower mappings.
190 .Dv RUNE2
191 is the lower case representation of
192 .Dv RUNE1 .
193 .It Dv MAPUPPER
194 Defines the toupper mappings.
195 .Dv RUNE2
196 is the upper case representation of
197 .Dv RUNE1 .
198 .It Dv TODIGIT
199 Defines a map from runes to their digit value.
200 .Dv RUNE2
201 is the integer value represented by
202 .Dv RUNE1 .
203 For example, the ASCII character
204 .Sq 0
205 would map to the decimal value 0.
206 Only values up to 255 are allowed.
207 .El
208 .Pp
209 The following keywords may appear multiple times and have the following
210 format for data:
211 .Bl -tag -width "RUNE1 THRU RUNEn" -offset indent
212 .It Dv RUNE
213 This rune has the property defined by the keyword.
214 .It Dv "RUNE1 THRU RUNEn"
215 All the runes between and including
216 .Dv RUNE1
217 and
218 .Dv RUNEn
219 have the property defined by the keyword.
220 .El
221 .Bl -tag -width PHONOGRAM
222 .It Dv ALPHA
223 Defines runes which are alphabetic, printable, and graphic.
224 .It Dv CONTROL
225 Defines runes which are control characters.
226 .It Dv DIGIT
227 Defines runes which are decimal digits, printable, and graphic.
228 .It Dv GRAPH
229 Defines runes which are graphic and printable.
230 .It Dv LOWER
231 Defines runes which are lower case, printable, and graphic.
232 .It Dv PUNCT
233 Defines runes which are punctuation, printable, and graphic.
234 .It Dv SPACE
235 Defines runes which are spaces.
236 .It Dv UPPER
237 Defines runes which are upper case, printable, and graphic.
238 .It Dv XDIGIT
239 Defines runes which are hexadecimal digits, printable, and graphic.
240 .It Dv BLANK
241 Defines runes which are blank.
242 .It Dv PRINT
243 Defines runes which are printable.
244 .It Dv IDEOGRAM
245 Defines runes which are ideograms, printable, and graphic.
246 .It Dv SPECIAL
247 Defines runes which are special characters, printable, and graphic.
248 .It Dv PHONOGRAM
249 Defines runes which are phonograms, printable, and graphic.
250 .It Dv SWIDTHn
251 Defines runes with specific glyph width.
252 .Ar n
253 takes 0 to 3.
254 .It Dv CHARSET
255 Controls character set for subsequent runes.
256 .\" To support
257 .\" .Xr iso2022 4
258 .\" locale definitions.
259 .El
260 .Sh SEE ALSO
261 .Xr colldef 1 ,
262 .Xr setlocale 3 ,
263 .Xr euc 5 ,
264 .Xr utf8 5 ,
265 .Xr nls 7
266 .Sh HISTORY
267 The
268 .Nm
269 utility first appeared in
270 .Bx 4.4 .
271 .Sh BUGS
272 The
273 .Nm
274 utility is overly simplistic.
275 .Pp
276 We should switch to
277 .Nm localedef
278 and its file format, which is more standard.