Complete Citrus import. Import message catalog implement from
[dragonfly.git] / usr.bin / mklocale / mklocale.1
CommitLineData
32a7b49a
JS
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.5 2005/04/21 16:36:35 joerg Exp $
4.\"
984263bc
MD
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.
32a7b49a 19.\" 3. Neither the name of the University nor the names of its contributors
984263bc
MD
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
984263bc 36.\"
32a7b49a 37.Dd April 18, 1994
984263bc
MD
38.Dt MKLOCALE 1
39.Os
40.Sh NAME
41.Nm mklocale
42.Nd make LC_CTYPE locale files
43.Sh SYNOPSIS
32a7b49a 44.Nm mklocale
984263bc 45.Op Fl d
32a7b49a
JS
46\*[Lt]
47.Ar src-file
48\*[Gt]
49.Ar language/LC_CTYPE
50.Nm mklocale
984263bc
MD
51.Op Fl d
52.Fl o
53.Ar language/LC_CTYPE
54.Ar src-file
55.Sh DESCRIPTION
56The
32a7b49a
JS
57.Nm mklocale
58utility reads an
984263bc 59.Dv LC_CTYPE
32a7b49a 60source file from standard input and produces an
984263bc
MD
61.Dv LC_CTYPE
62binary file on standard output suitable for placement in
32a7b49a 63.Pa /usr/share/locale/\*[Lt]language\*[Gt]/LC_CTYPE .
984263bc
MD
64.Pp
65The format of
66.Ar src-file
67is quite simple.
68It consists of a series of lines which start with a keyword and have
32a7b49a
JS
69associated data following.
70C style comments are used
984263bc
MD
71to place comments in the file.
72.Pp
73Following options are available:
32a7b49a 74.Bl -tag -width XXX
984263bc
MD
75.It Fl d
76Turns on debugging messages.
77.It Fl o
78Specify output file.
79.El
80.Pp
81Besides the keywords which will be listed below,
82the following are valid tokens in
83.Ar src-file :
32a7b49a 84.Bl -tag -width literal
984263bc
MD
85.It Dv RUNE
86A
87.Dv RUNE
88may be any of the following:
32a7b49a 89.Bl -tag -width 0x[0-9a-z]*
984263bc
MD
90.It Ar 'x'
91The ASCII character
92.Ar x .
93.It Ar '\ex'
94The ANSI C character
95.Ar \ex
96where
97.Ar \ex
98is one of
99.Dv \ea ,
100.Dv \eb ,
101.Dv \ef ,
102.Dv \en ,
103.Dv \er ,
104.Dv \et ,
105or
106.Dv \ev .
107.It Ar 0x[0-9a-z]*
108A hexadecimal number representing a rune code.
109.It Ar 0[0-7]*
110An octal number representing a rune code.
111.It Ar [1-9][0-9]*
112A decimal number representing a rune code.
113.El
114.It Dv STRING
115A string enclosed in double quotes (").
116.It Dv THRU
117Either
118.Dv ...
119or
120.Dv - .
121Used to indicate ranges.
122.It Ar literal
123The follow characters are taken literally:
32a7b49a
JS
124.Bl -tag -width "\*[Lt]\|\|(\|\|["
125.It Dv "\*[Lt]\|(\|["
126Used to start a mapping.
127All are equivalent.
128.It Dv "\*[Gt]\|\^)\|]"
129Used to end a mapping.
130All are equivalent.
984263bc
MD
131.It Dv :
132Used as a delimiter in mappings.
133.El
134.El
135.Pp
136Key words which should only appear once are:
137.Bl -tag -width PHONOGRAM
138.It Dv ENCODING
139Followed by a
140.Dv STRING
141which indicates the encoding mechanism to be used for this locale.
142The current encodings are:
143.Bl -tag -width NONE
144.It Dv NONE
145No translation and the default.
146.It Dv UTF2
147.Dv "Universal character set Transformation Format"
148adopted from
32a7b49a 149.Nm "Plan 9 from Bell Labs" .
984263bc
MD
150.It Dv EUC
151.Dv EUC
152encoding as used by several
153vendors of
154.Ux
155systems.
156.El
157.It Dv VARIABLE
158This keyword must be followed by a single tab or space character,
159after which encoding specific data is placed.
160Currently only the
161.Dv "EUC"
162encoding requires variable data.
163See
176008fc 164.Xr euc 5
984263bc 165for further details.
32a7b49a
JS
166.It Dv INVALID
167A single
168.Dv RUNE
984263bc
MD
169.El
170.Pp
171The following keywords may appear multiple times and have the following
172format for data:
32a7b49a
JS
173.in +.5i
174.Bl -tag -width "XXRUNE1 THRU RUNEn : RUNE2XX"
175.It Aq Dv RUNE1 RUNE2
984263bc
MD
176.Dv RUNE1
177is mapped to
178.Dv RUNE2 .
32a7b49a 179.It Aq Dv RUNE1 THRU RUNEn : RUNE2
984263bc
MD
180Runes
181.Dv RUNE1
182through
183.Dv RUNEn
184are mapped to
185.Dv RUNE2
186through
187.Dv RUNE2
188+ n-1.
189.El
32a7b49a
JS
190.in -.5i
191.Bl -tag -width PHONOGRAM
984263bc
MD
192.It Dv MAPLOWER
193Defines the tolower mappings.
194.Dv RUNE2
195is the lower case representation of
196.Dv RUNE1 .
197.It Dv MAPUPPER
198Defines the toupper mappings.
199.Dv RUNE2
200is the upper case representation of
201.Dv RUNE1 .
202.It Dv TODIGIT
203Defines a map from runes to their digit value.
204.Dv RUNE2
32a7b49a 205is the integer value represented by
984263bc
MD
206.Dv RUNE1 .
207For example, the ASCII character
32a7b49a 208.Sq 0
984263bc 209would map to the decimal value 0.
32a7b49a 210Only values up to 255 are allowed.
984263bc
MD
211.El
212.Pp
213The following keywords may appear multiple times and have the following
214format for data:
32a7b49a 215.Bl -tag -width "RUNE1 THRU RUNEn"
984263bc
MD
216.It Dv RUNE
217This rune has the property defined by the keyword.
218.It Dv "RUNE1 THRU RUNEn"
219All the runes between and including
220.Dv RUNE1
221and
222.Dv RUNEn
223have the property defined by the keyword.
224.El
32a7b49a 225.Bl -tag -width PHONOGRAM
984263bc 226.It Dv ALPHA
32a7b49a 227Defines runes which are alphabetic, printable, and graphic.
984263bc
MD
228.It Dv CONTROL
229Defines runes which are control characters.
230.It Dv DIGIT
32a7b49a 231Defines runes which are decimal digits, printable, and graphic.
984263bc
MD
232.It Dv GRAPH
233Defines runes which are graphic and printable.
234.It Dv LOWER
32a7b49a 235Defines runes which are lower case, printable, and graphic.
984263bc 236.It Dv PUNCT
32a7b49a 237Defines runes which are punctuation, printable, and graphic.
984263bc
MD
238.It Dv SPACE
239Defines runes which are spaces.
240.It Dv UPPER
32a7b49a 241Defines runes which are upper case, printable, and graphic.
984263bc 242.It Dv XDIGIT
32a7b49a 243Defines runes which are hexadecimal digits, printable, and graphic.
984263bc
MD
244.It Dv BLANK
245Defines runes which are blank.
246.It Dv PRINT
247Defines runes which are printable.
248.It Dv IDEOGRAM
32a7b49a 249Defines runes which are ideograms, printable, and graphic.
984263bc 250.It Dv SPECIAL
32a7b49a 251Defines runes which are special characters, printable, and graphic.
984263bc 252.It Dv PHONOGRAM
32a7b49a
JS
253Defines runes which are phonograms, printable, and graphic.
254.It Dv SWIDTHn
255Defines runes with specific glyph width.
256.Ar n
257takes 0 to 3.
258.It Dv CHARSET
259Controls character set for subsequent runes.
260.\" To support
261.\" .Xr iso2022 4
262.\" locale definitions.
984263bc
MD
263.El
264.Sh SEE ALSO
32a7b49a 265.\"Xr colldef 1 ,
984263bc 266.Xr setlocale 3 ,
32a7b49a
JS
267.\" .Xr euc 4 ,
268.\" .Xr utf8 4
269.Xr nls 7
984263bc
MD
270.Sh HISTORY
271The
32a7b49a 272.Nm mklocale
984263bc
MD
273utility first appeared in
274.Bx 4.4 .
32a7b49a
JS
275.Sh BUGS
276The
277.Nm mklocale
278utility is overly simplistic.
279.Pp
280We should switch to
281.Nm localedef
282and its file format, which is more standard.