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