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