Annotation of src/usr.bin/mklocale/mklocale.1, Revision 1.3
1.3 ! jmc 1: .\" $OpenBSD: mklocale.1,v 1.2 2005/08/11 14:30:53 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.3 ! jmc 38: .Dd $Mdocdate$
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.
131: .It Dv :
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.
207: Only values up to 255 are allowed.
208: .El
209: .Pp
210: The following keywords may appear multiple times and have the following
211: format for data:
212: .Bl -tag -width "RUNE1 THRU RUNEn"
213: .It Dv RUNE
214: This rune has the property defined by the keyword.
215: .It Dv "RUNE1 THRU RUNEn"
216: All the runes between and including
217: .Dv RUNE1
218: and
219: .Dv RUNEn
220: have the property defined by the keyword.
221: .El
222: .Bl -tag -width PHONOGRAM
223: .It Dv ALPHA
224: Defines runes which are alphabetic, printable, and graphic.
225: .It Dv CONTROL
226: Defines runes which are control characters.
227: .It Dv DIGIT
228: Defines runes which are decimal digits, printable, and graphic.
229: .It Dv GRAPH
230: Defines runes which are graphic and printable.
231: .It Dv LOWER
232: Defines runes which are lower case, printable, and graphic.
233: .It Dv PUNCT
234: Defines runes which are punctuation, printable, and graphic.
235: .It Dv SPACE
236: Defines runes which are spaces.
237: .It Dv UPPER
238: Defines runes which are upper case, printable, and graphic.
239: .It Dv XDIGIT
240: Defines runes which are hexadecimal digits, printable, and graphic.
241: .It Dv BLANK
242: Defines runes which are blank.
243: .It Dv PRINT
244: Defines runes which are printable.
245: .It Dv IDEOGRAM
246: Defines runes which are ideograms, printable, and graphic.
247: .It Dv SPECIAL
248: Defines runes which are special characters, printable, and graphic.
249: .It Dv PHONOGRAM
250: Defines runes which are phonograms, printable, and graphic.
251: .It Dv SWIDTHn
252: Defines runes with specific glyph width.
253: .Ar n
254: takes 0 to 3.
255: .It Dv CHARSET
256: Controls character set for subsequent runes.
257: .\" To support
258: .\" .Xr iso2022 4
259: .\" locale definitions.
260: .El
261: .Sh SEE ALSO
262: .\"Xr colldef 1 ,
1.2 jmc 263: .Xr setlocale 3
1.1 espie 264: .\" .Xr euc 4 ,
265: .\" .Xr utf8 4
1.2 jmc 266: .\" .Xr nls 7
1.1 espie 267: .Sh HISTORY
268: The
269: .Nm mklocale
270: utility first appeared in
271: .Bx 4.4 .
272: .Sh BUGS
273: The
274: .Nm mklocale
275: utility is overly simplistic.
276: .Pp
277: We should switch to
278: .Nm localedef
279: and its file format, which is more standard.