xref: /openbsd/usr.bin/mklocale/mklocale.1 (revision d89ec533)
1.\"	$OpenBSD: mklocale.1,v 1.6 2016/05/29 01:02:21 millert Exp $
2.\"
3.\" $NetBSD: mklocale.1,v 1.13 2004/01/24 17:03:26 wiz Exp $
4.\" FreeBSD: src/usr.bin/mklocale/mklocale.1,v 1.6 1999/09/20 09:15:21 phantom Exp
5.\"
6.\" Copyright (c) 1993, 1994
7.\"	The Regents of the University of California.  All rights reserved.
8.\"
9.\" This code is derived from software contributed to Berkeley by
10.\" Paul Borman at Krystal Technologies.
11.\"
12.\" Redistribution and use in source and binary forms, with or without
13.\" modification, are permitted provided that the following conditions
14.\" are met:
15.\" 1. Redistributions of source code must retain the above copyright
16.\"    notice, this list of conditions and the following disclaimer.
17.\" 2. Redistributions in binary form must reproduce the above copyright
18.\"    notice, this list of conditions and the following disclaimer in the
19.\"    documentation and/or other materials provided with the distribution.
20.\" 3. Neither the name of the University nor the names of its contributors
21.\"    may be used to endorse or promote products derived from this software
22.\"    without specific prior written permission.
23.\"
24.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
25.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
28.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34.\" SUCH DAMAGE.
35.\"
36.\"	@(#)mklocale.1	8.2 (Berkeley) 4/18/94
37.\"
38.Dd $Mdocdate: May 29 2016 $
39.Dt MKLOCALE 1
40.Os
41.Sh NAME
42.Nm mklocale
43.Nd make LC_CTYPE locale files
44.Sh SYNOPSIS
45.Nm mklocale
46.Op Fl d
47.Op Ar src-file
48.Ar language/LC_CTYPE
49.Nm mklocale
50.Op Fl d
51.Fl o
52.Ar language/LC_CTYPE
53.Ar src-file
54.Sh DESCRIPTION
55The
56.Nm mklocale
57utility reads an
58.Dv LC_CTYPE
59source file from standard input and produces an
60.Dv LC_CTYPE
61binary file on standard output suitable for placement in
62.Pa /usr/share/locale/\*(Ltlanguage\*(Gt/LC_CTYPE .
63.Pp
64The format of
65.Ar src-file
66is quite simple:
67it consists of a series of lines which start with a keyword and have
68associated data following.
69C-style comments are used
70to place comments in the file.
71.Pp
72The following options are available:
73.Bl -tag -width Ds
74.It Fl d
75Turns on debugging messages.
76.It Fl o
77Specify an output file.
78.El
79.Pp
80Besides the keywords which will be listed below,
81the following are valid tokens in
82.Ar src-file :
83.Bl -tag -width literal
84.It Dv RUNE
85A
86.Dv RUNE
87may be any of the following:
88.Bl -tag -width 0x[0-9a-z]*
89.It Ar 'x'
90The ASCII character
91.Ar x .
92.It Ar '\ex'
93The ANSI C character
94.Ar \ex
95where
96.Ar \ex
97is one of
98.Dv \ea ,
99.Dv \eb ,
100.Dv \ef ,
101.Dv \en ,
102.Dv \er ,
103.Dv \et ,
104or
105.Dv \ev .
106.It Ar 0x[0-9a-z]*
107A hexadecimal number representing a rune code.
108.It Ar 0[0-7]*
109An octal number representing a rune code.
110.It Ar [1-9][0-9]*
111A decimal number representing a rune code.
112.El
113.It Dv STRING
114A string enclosed in double quotes (").
115.It Dv THRU
116Either
117.Sq ...
118or
119.Sq - .
120Used to indicate ranges.
121.It Ar literal
122The follow characters are taken literally:
123.Pp
124.Bl -tag -width XXXXXXXXXX -compact
125.It Dv "\*(Lt \*(Ba ( \*(Ba ["
126Used to start a mapping.
127All are equivalent.
128.It Dv "\*(Gt \*(Ba ) \*(Ba ]"
129Used to end a mapping.
130All are equivalent.
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 Plan 9 from Bell Labs.
149.It Dv EUC
150.Dv EUC
151encoding as used by several
152vendors of
153.Ux
154systems.
155.El
156.It Dv VARIABLE
157This keyword must be followed by one or more tab or space characters,
158after which encoding specific data is placed.
159Currently only the
160.Dv "EUC"
161encoding requires variable data.
162.\" See
163.\" .Xr euc 4
164.\" for further details.
165.It Dv INVALID
166A single
167.Dv RUNE
168follows and is used as the invalid rune for this locale.
169.El
170.Pp
171The following keywords may appear multiple times and have the following
172format for data:
173.Bl -tag -width "XXRUNE1 THRU RUNEn : RUNE2XX" -offset indent
174.It Aq Dv RUNE1 RUNE2
175.Dv RUNE1
176is mapped to
177.Dv RUNE2 .
178.It Aq Dv RUNE1 THRU RUNEn : RUNE2
179Runes
180.Dv RUNE1
181through
182.Dv RUNEn
183are mapped to
184.Dv RUNE2
185through
186.Dv RUNE2
187.El
188.Bl -tag -width PHONOGRAM
189.It Dv MAPLOWER
190Defines the tolower mappings.
191.Dv RUNE2
192is the lower case representation of
193.Dv RUNE1 .
194.It Dv MAPUPPER
195Defines the toupper mappings.
196.Dv RUNE2
197is the upper case representation of
198.Dv RUNE1 .
199.It Dv TODIGIT
200Defines a map from runes to their digit value.
201.Dv RUNE2
202is the integer value represented by
203.Dv RUNE1 .
204For example, the ASCII character
205.Sq 0
206would map to the decimal value 0.
207On
208.Ox ,
209this information is ignored and not put into the binary output file.
210.El
211.Pp
212The following keywords may appear multiple times and have the following
213format for data:
214.Bl -tag -width "RUNE1 THRU RUNEn"
215.It Dv RUNE
216This rune has the property defined by the keyword.
217.It Dv "RUNE1 THRU RUNEn"
218All the runes between and including
219.Dv RUNE1
220and
221.Dv RUNEn
222have the property defined by the keyword.
223.El
224.Bl -tag -width PHONOGRAM
225.It Dv ALPHA
226Defines runes which are alphabetic, printable, and graphic.
227.It Dv CONTROL
228Defines runes which are control characters.
229.It Dv DIGIT
230Defines runes which are decimal digits, printable, and graphic.
231.It Dv GRAPH
232Defines runes which are graphic and printable.
233.It Dv LOWER
234Defines runes which are lower case, printable, and graphic.
235.It Dv PUNCT
236Defines runes which are punctuation, printable, and graphic.
237.It Dv SPACE
238Defines runes which are spaces.
239.It Dv UPPER
240Defines runes which are upper case, printable, and graphic.
241.It Dv XDIGIT
242Defines runes which are hexadecimal digits, printable, and graphic.
243.It Dv BLANK
244Defines runes which are blank.
245.It Dv PRINT
246Defines runes which are printable.
247.It Dv IDEOGRAM
248Defines runes which are ideograms, printable, and graphic.
249.It Dv SPECIAL
250Defines runes which are special characters, printable, and graphic.
251.It Dv PHONOGRAM
252Defines runes which are phonograms, printable, and graphic.
253.It Dv SWIDTHn
254Defines runes with specific glyph width.
255.Ar n
256takes 0 to 3.
257.It Dv CHARSET
258Controls character set for subsequent runes.
259.\" To support
260.\" .Xr iso2022 4
261.\" locale definitions.
262.El
263.Sh SEE ALSO
264.\"Xr colldef 1 ,
265.Xr setlocale 3
266.\" .Xr euc 4 ,
267.\" .Xr utf8 4
268.\" .Xr nls 7
269.Sh HISTORY
270The
271.Nm mklocale
272utility first appeared in
273.Bx 4.4 .
274.Sh BUGS
275The
276.Nm mklocale
277utility is overly simplistic.
278.Pp
279We should switch to
280.Nm localedef
281and its file format, which is more standard.
282