collate 4/4: Remove colldef(1) tool from base (swap bootstrap)
[dragonfly.git] / usr.bin / mklocale / mklocale.1
CommitLineData
984263bc
MD
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.
0d5acd74 15.\" 4. Neither the name of the University nor the names of its contributors
984263bc
MD
16.\" may be used to endorse or promote products derived from this software
17.\" without specific prior written permission.
18.\"
19.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29.\" SUCH DAMAGE.
30.\"
31.\" @(#)mklocale.1 8.2 (Berkeley) 4/18/94
0d5acd74 32.\" $FreeBSD: head/usr.bin/mklocale/mklocale.1 235400 2012-05-13 14:16:04Z joel $
984263bc 33.\"
0d5acd74 34.Dd October 17, 2004
984263bc
MD
35.Dt MKLOCALE 1
36.Os
37.Sh NAME
38.Nm mklocale
39.Nd make LC_CTYPE locale files
40.Sh SYNOPSIS
9b5a9965 41.Nm
984263bc 42.Op Fl d
0d5acd74
JM
43.Ar "< src-file"
44.Ar "> language/LC_CTYPE"
9b5a9965 45.Nm
984263bc
MD
46.Op Fl d
47.Fl o
48.Ar language/LC_CTYPE
49.Ar src-file
50.Sh DESCRIPTION
51The
9b5a9965 52.Nm
0d5acd74 53utility reads a
984263bc 54.Dv LC_CTYPE
0d5acd74 55source file from standard input and produces a
984263bc
MD
56.Dv LC_CTYPE
57binary file on standard output suitable for placement in
8e366689 58.Pa /usr/share/locale/ Ns Ar language Ns Pa /LC_CTYPE .
984263bc
MD
59.Pp
60The format of
61.Ar src-file
62is quite simple.
63It consists of a series of lines which start with a keyword and have
32a7b49a
JS
64associated data following.
65C style comments are used
984263bc
MD
66to place comments in the file.
67.Pp
68Following options are available:
0d5acd74 69.Bl -tag -width indent
984263bc
MD
70.It Fl d
71Turns on debugging messages.
72.It Fl o
73Specify output file.
74.El
75.Pp
76Besides the keywords which will be listed below,
77the following are valid tokens in
78.Ar src-file :
0d5acd74 79.Bl -tag -width ".Ar literal"
984263bc
MD
80.It Dv RUNE
81A
82.Dv RUNE
83may be any of the following:
0d5acd74 84.Bl -tag -width ".Ar 0x[0-9a-z]*"
984263bc
MD
85.It Ar 'x'
86The ASCII character
87.Ar x .
88.It Ar '\ex'
89The ANSI C character
90.Ar \ex
91where
92.Ar \ex
93is one of
94.Dv \ea ,
95.Dv \eb ,
96.Dv \ef ,
97.Dv \en ,
98.Dv \er ,
99.Dv \et ,
100or
101.Dv \ev .
102.It Ar 0x[0-9a-z]*
103A hexadecimal number representing a rune code.
104.It Ar 0[0-7]*
105An octal number representing a rune code.
106.It Ar [1-9][0-9]*
107A decimal number representing a rune code.
108.El
109.It Dv STRING
110A string enclosed in double quotes (").
111.It Dv THRU
112Either
113.Dv ...
114or
115.Dv - .
116Used to indicate ranges.
117.It Ar literal
118The follow characters are taken literally:
0d5acd74
JM
119.Bl -tag -width ".Dv <\|\|(\|\|["
120.It Dv "<\|(\|["
32a7b49a
JS
121Used to start a mapping.
122All are equivalent.
0d5acd74 123.It Dv ">\|\^)\|]"
32a7b49a
JS
124Used to end a mapping.
125All are equivalent.
0d5acd74 126.It Dv ":"
984263bc
MD
127Used as a delimiter in mappings.
128.El
129.El
130.Pp
131Key words which should only appear once are:
0d5acd74 132.Bl -tag -width ".Dv PHONOGRAM"
984263bc
MD
133.It Dv ENCODING
134Followed by a
135.Dv STRING
136which indicates the encoding mechanism to be used for this locale.
137The current encodings are:
0d5acd74
JM
138.Bl -tag -width ".Dv MSKanji"
139.It Dv ASCII
140American Standard Code for Information Interchange.
141.It Dv BIG5
142The
143.Dq Big5
144encoding of Chinese.
984263bc
MD
145.It Dv EUC
146.Dv EUC
147encoding as used by several
148vendors of
149.Ux
150systems.
0d5acd74
JM
151.It Dv GB18030
152PRC national standard for encoding of Chinese text.
153.It Dv GB2312
154Older PRC national standard for encoding Chinese text.
155.It Dv GBK
156A widely used encoding method for Chinese text,
157backwards compatible with GB\ 2312-1980.
158.It Dv MSKanji
159The method of encoding Japanese used by Microsoft,
160loosely based on JIS.
161Also known as
162.Dq "Shift JIS"
163and
164.Dq SJIS .
165.It Dv NONE
166No translation and the default.
167.It Dv UTF-8
168The
169.Dv UTF-8
170transformation format of
171.Tn ISO
17210646
173as defined by RFC 2279.
984263bc
MD
174.El
175.It Dv VARIABLE
176This keyword must be followed by a single tab or space character,
177after which encoding specific data is placed.
178Currently only the
179.Dv "EUC"
180encoding requires variable data.
181See
176008fc 182.Xr euc 5
984263bc 183for further details.
32a7b49a 184.It Dv INVALID
0d5acd74 185(obsolete)
32a7b49a
JS
186A single
187.Dv RUNE
0d5acd74 188follows and is used as the invalid rune for this locale.
984263bc
MD
189.El
190.Pp
191The following keywords may appear multiple times and have the following
192format for data:
0d5acd74
JM
193.Bl -tag -width ".Dv <RUNE1 THRU RUNEn : RUNE2>" -offset indent
194.It Dv <RUNE1 RUNE2>
984263bc
MD
195.Dv RUNE1
196is mapped to
197.Dv RUNE2 .
0d5acd74 198.It Dv <RUNE1 THRU RUNEn : RUNE2>
984263bc
MD
199Runes
200.Dv RUNE1
201through
202.Dv RUNEn
203are mapped to
204.Dv RUNE2
205through
206.Dv RUNE2
0d5acd74 207+ n-1.
984263bc 208.El
0d5acd74 209.Bl -tag -width ".Dv PHONOGRAM"
984263bc
MD
210.It Dv MAPLOWER
211Defines the tolower mappings.
212.Dv RUNE2
213is the lower case representation of
214.Dv RUNE1 .
215.It Dv MAPUPPER
216Defines the toupper mappings.
217.Dv RUNE2
218is the upper case representation of
219.Dv RUNE1 .
220.It Dv TODIGIT
221Defines a map from runes to their digit value.
222.Dv RUNE2
32a7b49a 223is the integer value represented by
984263bc
MD
224.Dv RUNE1 .
225For example, the ASCII character
0d5acd74 226.Ql 0
984263bc 227would map to the decimal value 0.
0d5acd74
JM
228Only values up to 255
229are allowed.
984263bc
MD
230.El
231.Pp
232The following keywords may appear multiple times and have the following
233format for data:
0d5acd74 234.Bl -tag -width ".Dv RUNE1 THRU RUNEn" -offset indent
984263bc
MD
235.It Dv RUNE
236This rune has the property defined by the keyword.
237.It Dv "RUNE1 THRU RUNEn"
238All the runes between and including
239.Dv RUNE1
240and
241.Dv RUNEn
242have the property defined by the keyword.
243.El
0d5acd74 244.Bl -tag -width ".Dv PHONOGRAM"
984263bc 245.It Dv ALPHA
0d5acd74 246Defines runes which are alphabetic, printable and graphic.
984263bc
MD
247.It Dv CONTROL
248Defines runes which are control characters.
249.It Dv DIGIT
0d5acd74 250Defines runes which are decimal digits, printable and graphic.
984263bc
MD
251.It Dv GRAPH
252Defines runes which are graphic and printable.
253.It Dv LOWER
0d5acd74 254Defines runes which are lower case, printable and graphic.
984263bc 255.It Dv PUNCT
0d5acd74 256Defines runes which are punctuation, printable and graphic.
984263bc
MD
257.It Dv SPACE
258Defines runes which are spaces.
259.It Dv UPPER
0d5acd74 260Defines runes which are upper case, printable and graphic.
984263bc 261.It Dv XDIGIT
0d5acd74 262Defines runes which are hexadecimal digits, printable and graphic.
984263bc
MD
263.It Dv BLANK
264Defines runes which are blank.
265.It Dv PRINT
266Defines runes which are printable.
267.It Dv IDEOGRAM
0d5acd74 268Defines runes which are ideograms, printable and graphic.
984263bc 269.It Dv SPECIAL
0d5acd74 270Defines runes which are special characters, printable and graphic.
984263bc 271.It Dv PHONOGRAM
0d5acd74
JM
272Defines runes which are phonograms, printable and graphic.
273.It Dv SWIDTH0
274Defines runes with display width 0.
275.It Dv SWIDTH1
276Defines runes with display width 1.
277.It Dv SWIDTH2
278Defines runes with display width 2.
279.It Dv SWIDTH3
280Defines runes with display width 3.
984263bc 281.El
0d5acd74
JM
282.Pp
283If no display width explicitly defined, width 1 assumed
284for printable runes by default.
984263bc 285.Sh SEE ALSO
984263bc 286.Xr setlocale 3 ,
0d5acd74
JM
287.Xr wcwidth 3 ,
288.Xr big5 5 ,
8e366689 289.Xr euc 5 ,
0d5acd74
JM
290.Xr gb18030 5 ,
291.Xr gb2312 5 ,
292.Xr gbk 5 ,
293.Xr mskanji 5 ,
294.Xr utf8 5
984263bc
MD
295.Sh HISTORY
296The
9b5a9965 297.Nm
984263bc
MD
298utility first appeared in
299.Bx 4.4 .
32a7b49a
JS
300.Sh BUGS
301The
9b5a9965 302.Nm
32a7b49a 303utility is overly simplistic.