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