]> CyberLeo.Net >> Repos - FreeBSD/releng/7.2.git/blob - usr.bin/mklocale/mklocale.1
Create releng/7.2 from stable/7 in preparation for 7.2-RELEASE.
[FreeBSD/releng/7.2.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$
37 .\"
38 .Dd October 17, 2004
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.
69 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.
126 All are equivalent.
127 .It Dv ">\|\^)\|]"
128 Used to end a mapping.
129 All are equivalent.
130 .It Dv :
131 Used as a delimiter in mappings.
132 .El
133 .El
134 .Pp
135 Key words which should only appear once are:
136 .Bl -tag -width ".Dv PHONOGRAM"
137 .It Dv ENCODING
138 Followed by a
139 .Dv STRING
140 which indicates the encoding mechanism to be used for this locale.
141 The current encodings are:
142 .Bl -tag -width ".Dv MSKanji"
143 .It Dv BIG5
144 The
145 .Dq Big5
146 encoding of Chinese.
147 .It Dv EUC
148 .Dv EUC
149 encoding as used by several
150 vendors of
151 .Ux
152 systems.
153 .It Dv GB18030
154 PRC national standard for encoding of Chinese text.
155 .It Dv GB2312
156 Older PRC national standard for encoding Chinese text.
157 .It Dv GBK
158 A widely used encoding method for Chinese text,
159 backwards compatible with GB\ 2312-1980.
160 .It Dv MSKanji
161 The method of encoding Japanese used by Microsoft,
162 loosely based on JIS.
163 Also known as
164 .Dq "Shift JIS"
165 and
166 .Dq SJIS .
167 .It Dv NONE
168 No translation and the default.
169 .It Dv UTF-8
170 The
171 .Dv UTF-8
172 transformation format of
173 .Tn ISO
174 10646
175 as defined by RFC 2279.
176 .El
177 .It Dv VARIABLE
178 This keyword must be followed by a single tab or space character,
179 after which encoding specific data is placed.
180 Currently only the
181 .Dv "EUC"
182 encoding requires variable data.
183 See
184 .Xr euc 5
185 for further details.
186 .It Dv INVALID
187 (obsolete)
188 A single
189 .Dv RUNE
190 follows and is used as the invalid rune for this locale.
191 .El
192 .Pp
193 The following keywords may appear multiple times and have the following
194 format for data:
195 .Bl -tag -width ".Dv <RUNE1 THRU RUNEn : RUNE2>" -offset indent
196 .It Dv <RUNE1 RUNE2>
197 .Dv RUNE1
198 is mapped to
199 .Dv RUNE2 .
200 .It Dv <RUNE1 THRU RUNEn : RUNE2>
201 Runes
202 .Dv RUNE1
203 through
204 .Dv RUNEn
205 are mapped to
206 .Dv RUNE2
207 through
208 .Dv RUNE2
209 + n-1.
210 .El
211 .Bl -tag -width ".Dv PHONOGRAM"
212 .It Dv MAPLOWER
213 Defines the tolower mappings.
214 .Dv RUNE2
215 is the lower case representation of
216 .Dv RUNE1 .
217 .It Dv MAPUPPER
218 Defines the toupper mappings.
219 .Dv RUNE2
220 is the upper case representation of
221 .Dv RUNE1 .
222 .It Dv TODIGIT
223 Defines a map from runes to their digit value.
224 .Dv RUNE2
225 is the integer value represented by
226 .Dv RUNE1 .
227 For example, the ASCII character
228 .Ql 0
229 would map to the decimal value 0.
230 Only values up to 255
231 are allowed.
232 .El
233 .Pp
234 The following keywords may appear multiple times and have the following
235 format for data:
236 .Bl -tag -width ".Dv RUNE1 THRU RUNEn" -offset indent
237 .It Dv RUNE
238 This rune has the property defined by the keyword.
239 .It Dv "RUNE1 THRU RUNEn"
240 All the runes between and including
241 .Dv RUNE1
242 and
243 .Dv RUNEn
244 have the property defined by the keyword.
245 .El
246 .Bl -tag -width ".Dv PHONOGRAM"
247 .It Dv ALPHA
248 Defines runes which are alphabetic, printable and graphic.
249 .It Dv CONTROL
250 Defines runes which are control characters.
251 .It Dv DIGIT
252 Defines runes which are decimal digits, printable and graphic.
253 .It Dv GRAPH
254 Defines runes which are graphic and printable.
255 .It Dv LOWER
256 Defines runes which are lower case, printable and graphic.
257 .It Dv PUNCT
258 Defines runes which are punctuation, printable and graphic.
259 .It Dv SPACE
260 Defines runes which are spaces.
261 .It Dv UPPER
262 Defines runes which are upper case, printable and graphic.
263 .It Dv XDIGIT
264 Defines runes which are hexadecimal digits, printable and graphic.
265 .It Dv BLANK
266 Defines runes which are blank.
267 .It Dv PRINT
268 Defines runes which are printable.
269 .It Dv IDEOGRAM
270 Defines runes which are ideograms, printable and graphic.
271 .It Dv SPECIAL
272 Defines runes which are special characters, printable and graphic.
273 .It Dv PHONOGRAM
274 Defines runes which are phonograms, printable and graphic.
275 .It Dv SWIDTH0
276 Defines runes with display width 0.
277 .It Dv SWIDTH1
278 Defines runes with display width 1.
279 .It Dv SWIDTH2
280 Defines runes with display width 2.
281 .It Dv SWIDTH3
282 Defines runes with display width 3.
283 .El
284 .Pp
285 If no display width explicitly defined, width 1 assumed
286 for printable runes by default.
287 .Sh SEE ALSO
288 .Xr colldef 1 ,
289 .Xr setlocale 3 ,
290 .Xr wcwidth 3 ,
291 .Xr big5 5 ,
292 .Xr euc 5 ,
293 .Xr gb18030 5 ,
294 .Xr gb2312 5 ,
295 .Xr gbk 5 ,
296 .Xr mskanji 5 ,
297 .Xr utf8 5
298 .Sh HISTORY
299 The
300 .Nm
301 utility first appeared in
302 .Bx 4.4 .
303 .Sh BUGS
304 The
305 .Nm
306 utility is overly simplistic.