Initial import from FreeBSD RELENG_4:
[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 .\"
38 .Dd April 18, 1994
39 .Dt MKLOCALE 1
40 .Os
41 .Sh NAME
42 .Nm mklocale
43 .Nd make LC_CTYPE locale files
44 .Sh SYNOPSIS
45 .Nm
46 .Op Fl d
47 .Ar "< src-file"
48 .Ar "> language/LC_CTYPE"
49 .Nm
50 .Op Fl d
51 .Fl o
52 .Ar language/LC_CTYPE
53 .Ar src-file
54 .Sh DESCRIPTION
55 The
56 .Nm
57 utility reads a
58 .Dv LC_CTYPE
59 source file from standard input and produces a
60 .Dv LC_CTYPE
61 binary file on standard output suitable for placement in
62 .Pa /usr/share/locale/ Ns Ar language Ns Pa /LC_CTYPE .
63 .Pp
64 The format of
65 .Ar src-file
66 is quite simple.
67 It consists of a series of lines which start with a keyword and have
68 associated data following.  C style comments are used
69 to place comments in the file.
70 .Pp
71 Following options are available:
72 .Bl -tag -width indent
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 ".Ar literal"
83 .It Dv RUNE
84 A
85 .Dv RUNE
86 may be any of the following:
87 .Bl -tag -width ".Ar 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 ".Dv <\|\|(\|\|["
123 .It Dv "<\|(\|["
124 Used to start a mapping.  All are equivalent.
125 .It Dv ">\|\^)\|]"
126 Used to end a mapping.  All are equivalent.
127 .It Dv :
128 Used as a delimiter in mappings.
129 .El
130 .El
131 .Pp
132 Key words which should only appear once are:
133 .Bl -tag -width PHONOGRAM
134 .It Dv ENCODING
135 Followed by a
136 .Dv STRING
137 which indicates the encoding mechanism to be used for this locale.
138 The current encodings are:
139 .Bl -tag -width NONE
140 .It Dv NONE
141 No translation and the default.
142 .It Dv UTF2
143 .Dv "Universal character set Transformation Format"
144 adopted from
145 .Tn "Plan 9 from Bell Labs" .
146 This is the preferred encoding.
147 .It Dv EUC
148 .Dv EUC
149 encoding as used by several
150 vendors of
151 .Ux
152 systems.
153 .El
154 .It Dv VARIABLE
155 This keyword must be followed by a single tab or space character,
156 after which encoding specific data is placed.
157 Currently only the
158 .Dv "EUC"
159 encoding requires variable data.
160 See
161 .Xr euc 4
162 for further details.
163 .It Dv INVALID
164 A single
165 .Dv RUNE
166 follows and is used as the invalid rune for this locale.
167 .El
168 .Pp
169 The following keywords may appear multiple times and have the following
170 format for data:
171 .Bl -tag -width ".Dv <RUNE1 THRU RUNEn : RUNE2>" -offset indent
172 .It Dv <RUNE1 RUNE2>
173 .Dv RUNE1
174 is mapped to
175 .Dv RUNE2 .
176 .It 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 ".Dv 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 .Ql 0
205 would map to the decimal value 0.
206 Only values up to 255
207 are allowed.
208 .El
209 .Pp
210 The following keywords may appear multiple times and have the following
211 format for data:
212 .Bl -tag -width ".Dv RUNE1 THRU RUNEn" -offset indent
213 .It Dv RUNE
214 This rune has the property defined by the keyword.
215 .It Dv "RUNE1 THRU RUNEn"
216 All the runes between and including
217 .Dv RUNE1
218 and
219 .Dv RUNEn
220 have the property defined by the keyword.
221 .El
222 .Bl -tag -width ".Dv PHONOGRAM"
223 .It Dv ALPHA
224 Defines runes which are alphabetic, printable and graphic.
225 .It Dv CONTROL
226 Defines runes which are control characters.
227 .It Dv DIGIT
228 Defines runes which are decimal digits, printable and graphic.
229 .It Dv GRAPH
230 Defines runes which are graphic and printable.
231 .It Dv LOWER
232 Defines runes which are lower case, printable and graphic.
233 .It Dv PUNCT
234 Defines runes which are punctuation, printable and graphic.
235 .It Dv SPACE
236 Defines runes which are spaces.
237 .It Dv UPPER
238 Defines runes which are upper case, printable and graphic.
239 .It Dv XDIGIT
240 Defines runes which are hexadecimal digits, printable and graphic.
241 .It Dv BLANK
242 Defines runes which are blank.
243 .It Dv PRINT
244 Defines runes which are printable.
245 .It Dv IDEOGRAM
246 Defines runes which are ideograms, printable and graphic.
247 .It Dv SPECIAL
248 Defines runes which are special characters, printable and graphic.
249 .It Dv PHONOGRAM
250 Defines runes which are phonograms, printable and graphic.
251 .El
252 .Sh SEE ALSO
253 .Xr colldef 1 ,
254 .Xr mbrune 3 ,
255 .Xr rune 3 ,
256 .Xr setlocale 3 ,
257 .Xr euc 4 ,
258 .Xr utf2 4
259 .Sh BUGS
260 The
261 .Nm
262 utility is overly simplistic.
263 .Sh HISTORY
264 The
265 .Nm
266 utility first appeared in
267 .Bx 4.4 .