Annotation of src/usr.bin/mklocale/mklocale.1, Revision 1.5
1.5 ! schwarze 1: .\" $OpenBSD: mklocale.1,v 1.4 2010/09/19 21:30:05 jmc Exp $
1.2 jmc 2: .\"
1.1 espie 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: .\"
1.5 ! schwarze 38: .Dd $Mdocdate: September 19 2010 $
1.1 espie 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
1.2 jmc 47: .Op Ar src-file
1.1 espie 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
55: The
56: .Nm mklocale
57: utility reads an
58: .Dv LC_CTYPE
59: source file from standard input and produces an
60: .Dv LC_CTYPE
61: binary file on standard output suitable for placement in
1.2 jmc 62: .Pa /usr/share/locale/\*(Ltlanguage\*(Gt/LC_CTYPE .
1.1 espie 63: .Pp
64: The format of
65: .Ar src-file
1.2 jmc 66: is quite simple:
67: it consists of a series of lines which start with a keyword and have
1.1 espie 68: associated data following.
1.2 jmc 69: C-style comments are used
1.1 espie 70: to place comments in the file.
71: .Pp
1.2 jmc 72: The following options are available:
73: .Bl -tag -width Ds
1.1 espie 74: .It Fl d
75: Turns on debugging messages.
76: .It Fl o
1.2 jmc 77: Specify an output file.
1.1 espie 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 literal
84: .It Dv RUNE
85: A
86: .Dv RUNE
87: may be any of the following:
88: .Bl -tag -width 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
1.2 jmc 117: .Sq ...
1.1 espie 118: or
1.2 jmc 119: .Sq - .
1.1 espie 120: Used to indicate ranges.
121: .It Ar literal
122: The follow characters are taken literally:
1.2 jmc 123: .Pp
124: .Bl -tag -width XXXXXXXXXX -compact
125: .It Dv "\*(Lt \*(Ba ( \*(Ba ["
1.1 espie 126: Used to start a mapping.
127: All are equivalent.
1.2 jmc 128: .It Dv "\*(Gt \*(Ba ) \*(Ba ]"
1.1 espie 129: Used to end a mapping.
130: All are equivalent.
1.4 jmc 131: .It Dv \&:
1.1 espie 132: Used as a delimiter in mappings.
133: .El
134: .El
135: .Pp
136: Key words which should only appear once are:
137: .Bl -tag -width PHONOGRAM
138: .It Dv ENCODING
139: Followed by a
140: .Dv STRING
141: which indicates the encoding mechanism to be used for this locale.
142: The current encodings are:
143: .Bl -tag -width NONE
144: .It Dv NONE
145: No translation and the default.
146: .It Dv UTF2
147: .Dv "Universal character set Transformation Format"
1.2 jmc 148: adopted from Plan 9 from Bell Labs.
1.1 espie 149: .It Dv EUC
150: .Dv EUC
151: encoding as used by several
152: vendors of
153: .Ux
154: systems.
155: .El
156: .It Dv VARIABLE
157: This keyword must be followed by a single tab or space character,
158: after which encoding specific data is placed.
159: Currently only the
160: .Dv "EUC"
161: encoding requires variable data.
162: .\" See
163: .\" .Xr euc 4
164: .\" for further details.
165: .It Dv INVALID
166: A single
167: .Dv RUNE
168: follows and is used as the invalid rune for this locale.
169: .El
170: .Pp
171: The following keywords may appear multiple times and have the following
172: format for data:
1.2 jmc 173: .Bl -tag -width "XXRUNE1 THRU RUNEn : RUNE2XX" -offset indent
1.1 espie 174: .It Aq Dv RUNE1 RUNE2
175: .Dv RUNE1
176: is mapped to
177: .Dv RUNE2 .
178: .It Aq Dv RUNE1 THRU RUNEn : RUNE2
179: Runes
180: .Dv RUNE1
181: through
182: .Dv RUNEn
183: are mapped to
184: .Dv RUNE2
185: through
186: .Dv RUNE2
187: .El
188: .Bl -tag -width PHONOGRAM
189: .It Dv MAPLOWER
190: Defines the tolower mappings.
191: .Dv RUNE2
192: is the lower case representation of
193: .Dv RUNE1 .
194: .It Dv MAPUPPER
195: Defines the toupper mappings.
196: .Dv RUNE2
197: is the upper case representation of
198: .Dv RUNE1 .
199: .It Dv TODIGIT
200: Defines a map from runes to their digit value.
201: .Dv RUNE2
202: is the integer value represented by
203: .Dv RUNE1 .
204: For example, the ASCII character
205: .Sq 0
206: would map to the decimal value 0.
1.5 ! schwarze 207: On
! 208: .Ox ,
! 209: this information is ignored and not put into the binary output file.
1.1 espie 210: .El
211: .Pp
212: The following keywords may appear multiple times and have the following
213: format for data:
214: .Bl -tag -width "RUNE1 THRU RUNEn"
215: .It Dv RUNE
216: This rune has the property defined by the keyword.
217: .It Dv "RUNE1 THRU RUNEn"
218: All the runes between and including
219: .Dv RUNE1
220: and
221: .Dv RUNEn
222: have the property defined by the keyword.
223: .El
224: .Bl -tag -width PHONOGRAM
225: .It Dv ALPHA
226: Defines runes which are alphabetic, printable, and graphic.
227: .It Dv CONTROL
228: Defines runes which are control characters.
229: .It Dv DIGIT
230: Defines runes which are decimal digits, printable, and graphic.
231: .It Dv GRAPH
232: Defines runes which are graphic and printable.
233: .It Dv LOWER
234: Defines runes which are lower case, printable, and graphic.
235: .It Dv PUNCT
236: Defines runes which are punctuation, printable, and graphic.
237: .It Dv SPACE
238: Defines runes which are spaces.
239: .It Dv UPPER
240: Defines runes which are upper case, printable, and graphic.
241: .It Dv XDIGIT
242: Defines runes which are hexadecimal digits, printable, and graphic.
243: .It Dv BLANK
244: Defines runes which are blank.
245: .It Dv PRINT
246: Defines runes which are printable.
247: .It Dv IDEOGRAM
248: Defines runes which are ideograms, printable, and graphic.
249: .It Dv SPECIAL
250: Defines runes which are special characters, printable, and graphic.
251: .It Dv PHONOGRAM
252: Defines runes which are phonograms, printable, and graphic.
253: .It Dv SWIDTHn
254: Defines runes with specific glyph width.
255: .Ar n
256: takes 0 to 3.
257: .It Dv CHARSET
258: Controls 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 ,
1.2 jmc 265: .Xr setlocale 3
1.1 espie 266: .\" .Xr euc 4 ,
267: .\" .Xr utf8 4
1.2 jmc 268: .\" .Xr nls 7
1.1 espie 269: .Sh HISTORY
270: The
271: .Nm mklocale
272: utility first appeared in
273: .Bx 4.4 .
274: .Sh BUGS
275: The
276: .Nm mklocale
277: utility is overly simplistic.
278: .Pp
279: We should switch to
280: .Nm localedef
281: and its file format, which is more standard.