BSD 4_4 release
[unix-history] / usr / src / usr.bin / mklocale / mklocale.1
CommitLineData
ad787160
C
1.\" Copyright (c) 1993
2.\" The Regents of the University of California. All rights reserved.
8a7debe3
KB
3.\"
4.\" This code is derived from software contributed to Berkeley by
5.\" Paul Borman at Krystal Technologies.
6.\"
ad787160
C
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\" 1. Redistributions of source code must retain the above copyright
11.\" notice, this list of conditions and the following disclaimer.
12.\" 2. Redistributions in binary form must reproduce the above copyright
13.\" notice, this list of conditions and the following disclaimer in the
14.\" documentation and/or other materials provided with the distribution.
15.\" 3. All advertising materials mentioning features or use of this software
16.\" must display the following acknowledgement:
17.\" This product includes software developed by the University of
18.\" California, Berkeley and its contributors.
19.\" 4. Neither the name of the University nor the names of its contributors
20.\" may be used to endorse or promote products derived from this software
21.\" without specific prior written permission.
8a7debe3 22.\"
ad787160
C
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.
8a7debe3 34.\"
ad787160
C
35.\" @(#)mklocale.1 8.1 (Berkeley) 6/6/93
36.\"
37.Dd "June 6, 1993"
8a7debe3
KB
38.Dt MKLOCALE 1
39.Os
40.Sh NAME
41.Nm mklocale
42.Nd make LC_CTYPE locale files
43.Sh SYNOPSIS
44.Nm mklocale
45.Ar "< src-file"
46.Ar "> language/LC_CTYPE"
47.Sh DESCRIPTION
48The
49.Nm mklocale
50utility reads a
51.Dv LC_CTYPE
52source file from standard input and produces a
53.Dv LC_CTYPE
54binary file on standard output suitable for placement in
55.Dv /usr/share/locale/\fIlanguage\fP/LC_CTYPE.
56.Pp
57The format of
58.Ar src-file
59is quite simple.
60It consists of a series of lines which start with a keyword and have
61associated data following. C style comments are used
62to place comments in the file.
63.Pp
64Besides the keywords which will be listed below,
65the following are valid tokens in
66.Ar src-file :
67.Bl -tag -width literal
68.It Dv RUNE
69A
70.Dv RUNE
71may be any of the following:
72.Bl -tag -width 0x[0-9a-z]*
73.It Ar 'x'
74The ascii character
75.Ar x .
76.It Ar '\ex'
77The ANSI C character
78.Ar \ex
79where
80.Ar \ex
81is one of
82.Dv \ea ,
83.Dv \eb ,
84.Dv \ef ,
85.Dv \en ,
86.Dv \er ,
87.Dv \et ,
88or
89.Dv \ev .
90.It Ar 0x[0-9a-z]*
91A hexadecimal number representing a rune code.
92.It Ar 0[0-7]*
93An octal number representing a rune code.
94.It Ar [1-9][0-9]*
95A decimal number representing a rune code.
96.El
97.It Dv STRING
98A string enclosed in double quotes (").
99.It Dv THRU
100Either
101.Dv ...
102or
103.Dv - .
104Used to indicate ranges.
105.It Ar literal
106The follow characters are taken literally:
107.Bl -tag -width "<\|\|(\|\|["
108.It Dv "<\|(\|["
109Used to start a mapping. All are equivalent.
110.It Dv ">\|\^)\|]"
111Used to end a mapping. All are equivalent.
112.It Dv :
113Used as a delimiter in mappings.
114.El
115.El
116.sp
117Key words which should only appear once are:
118.Bl -tag -width PHONOGRAM
119.It Dv ENCODING
120Followed by a
121.Dv STRING
122which indicates the encoding mechanism to be used for this locale.
123The current encodings are:
124.Bl -tag -width NONE
125.It Dv NONE
126No translation and the default.
127.It Dv UTF2
128.Dv "Universal character set Transformation Format"
129adopted from
130.Nm "Plan 9 from Bell Labs" .
131This is the preferred encoding.
132.It Dv EUC
133.Dv EUC
134encoding as used by several
135vendors of
136.Ux
137systems.
138.El
139.It Dv VARIABLE
140This keyword must be followed by a single tab or space character,
141after which encoding specific data is placed.
142Currently only the
143.Dv "EUC"
144encoding requires variable data.
145See
146.Xr euc 4
147for further details.
148.It Dv INVALID
149A single
150.Dv RUNE
151follows and is used as the invalid rune for this locale.
152.El
153.sp
154The following keywords may appear multiple times and have the following
155format for data:
156.in +.5i
157.Bl -tag -width "<RUNE1 THRU RUNEn : RUNE2>"
158.It Dv <RUNE1 RUNE2>
159.Dv RUNE1
160is mapped to
161.Dv RUNE2 .
162.It Dv <RUNE1 THRU RUNEn : RUNE2>
163Runes
164.Dv RUNE1
165through
166.Dv RUNEn
167are mapped to
168.Dv RUNE2
169through
170.Dv RUNE2
171+ n-1.
172.El
173.in -.5i
174.Bl -tag -width PHONOGRAM
175.It Dv MAPLOWER
176Defines the tolower mappings.
177.Dv RUNE2
178is the lower case representatin of
179.Dv RUNE1.
180.It Dv MAPUPPER
181Defines the toupper mappings.
182.Dv RUNE2
183is the upper case representatin of
184.Dv RUNE1.
185.It Dv TODIGIT
186Defines a map from runes to their digit value.
187.Dv RUNE2
188is the integer value represented by
189.Dv RUNE1 .
190For example, the ascii character
191.Nm '0'
192would map to the decimal value
193.Nm 0 .
194Only values up to
195.Nm 255
196are allowed.
197.El
198.sp
199The following keywords may appear multiple times and have the following
200format for data:
201.in +.5i
202.Bl -tag -width "RUNE1 THRU RUNEn"
203.It Dv RUNE
204This rune has the property defined by the keyword.
205.It Dv "RUNE1 THRU RUNEn"
206All the runes between and including
207.Dv RUNE1
208and
209.Dv RUNEn
210have the property defined by the keyword.
211.El
212.in -.5i
213.Bl -tag -width PHONOGRAM
214.It Dv ALPHA
215Defines runes which are alphabetic, printable and graphic.
216.It Dv CONTROL
217Defines runes which are control characters.
218.It Dv DIGIT
219Defines runes which are decimal digits, printable and graphic.
220.It Dv GRAPH
221Defines runes which are graphic and printable.
222.It Dv LOWER
223Defines runes which are lower case, printable and graphic.
224.It Dv PUNCT
225Defines runes which are punctuation, printable and graphic.
226.It Dv SPACE
227Defines runes which are spaces.
228.It Dv UPPER
229Defines runes which are upper case, printable and graphic.
230.It Dv XDIGIT
231Defines runes which are hexadecimal digits, printable and graphic.
232.It Dv BLANK
233Defines runes which are blank.
234.It Dv PRINT
235Defines runes which are printable.
236.It Dv IDEOGRAM
237Defines runes which are ideograms, printable and graphic.
238.It Dv SPECIAL
239Defines runes which are special characters, printable and graphic.
240.It Dv PHONOGRAM
241Defines runes which are phonograms, printable and graphic.
242.El
243.Sh SEE ALSO
244.Xr mbrune 3 ,
245.Xr rune 3 ,
246.Xr setlocale 3 ,
247.Xr euc 4 ,
248.Xr utf2 4
249.Sh BUGS
250The
251.Nm mklocale
252utility is overly simplistic.
253.Sh HISTORY
254The
255.Nm mklocale
256utility first appeared in
257.Bx 4.4 .