PageRenderTime 39ms CodeModel.GetById 35ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/usr.bin/mklocale/mklocale.1

https://bitbucket.org/freebsd/freebsd-head/
Unknown | 304 lines | 304 code | 0 blank | 0 comment | 0 complexity | 7623150585815f3ba396a5c2c4bbcae7 MD5 | raw file
  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.\" 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.\" 4. Neither the name of the University nor the names of its contributors
 16.\"    may be used to endorse or promote products derived from this software
 17.\"    without specific prior written permission.
 18.\"
 19.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 20.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 21.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 22.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 23.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 24.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 25.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 26.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 27.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 28.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 29.\" SUCH DAMAGE.
 30.\"
 31.\"	@(#)mklocale.1	8.2 (Berkeley) 4/18/94
 32.\" $FreeBSD$
 33.\"
 34.Dd October 17, 2004
 35.Dt MKLOCALE 1
 36.Os
 37.Sh NAME
 38.Nm mklocale
 39.Nd make LC_CTYPE locale files
 40.Sh SYNOPSIS
 41.Nm
 42.Op Fl d
 43.Ar "< src-file"
 44.Ar "> language/LC_CTYPE"
 45.Nm
 46.Op Fl d
 47.Fl o
 48.Ar language/LC_CTYPE
 49.Ar src-file
 50.Sh DESCRIPTION
 51The
 52.Nm
 53utility reads a
 54.Dv LC_CTYPE
 55source file from standard input and produces a
 56.Dv LC_CTYPE
 57binary file on standard output suitable for placement in
 58.Pa /usr/share/locale/ Ns Ar language Ns Pa /LC_CTYPE .
 59.Pp
 60The format of
 61.Ar src-file
 62is quite simple.
 63It consists of a series of lines which start with a keyword and have
 64associated data following.
 65C style comments are used
 66to place comments in the file.
 67.Pp
 68Following options are available:
 69.Bl -tag -width indent
 70.It Fl d
 71Turns on debugging messages.
 72.It Fl o
 73Specify output file.
 74.El
 75.Pp
 76Besides the keywords which will be listed below,
 77the following are valid tokens in
 78.Ar src-file :
 79.Bl -tag -width ".Ar literal"
 80.It Dv RUNE
 81A
 82.Dv RUNE
 83may be any of the following:
 84.Bl -tag -width ".Ar 0x[0-9a-z]*"
 85.It Ar 'x'
 86The ASCII character
 87.Ar x .
 88.It Ar '\ex'
 89The ANSI C character
 90.Ar \ex
 91where
 92.Ar \ex
 93is one of
 94.Dv \ea ,
 95.Dv \eb ,
 96.Dv \ef ,
 97.Dv \en ,
 98.Dv \er ,
 99.Dv \et ,
100or
101.Dv \ev .
102.It Ar 0x[0-9a-z]*
103A hexadecimal number representing a rune code.
104.It Ar 0[0-7]*
105An octal number representing a rune code.
106.It Ar [1-9][0-9]*
107A decimal number representing a rune code.
108.El
109.It Dv STRING
110A string enclosed in double quotes (").
111.It Dv THRU
112Either
113.Dv ...
114or
115.Dv - .
116Used to indicate ranges.
117.It Ar literal
118The follow characters are taken literally:
119.Bl -tag -width ".Dv <\|\|(\|\|["
120.It Dv "<\|(\|["
121Used to start a mapping.
122All are equivalent.
123.It Dv ">\|\^)\|]"
124Used to end a mapping.
125All are equivalent.
126.It Dv ":"
127Used as a delimiter in mappings.
128.El
129.El
130.Pp
131Key words which should only appear once are:
132.Bl -tag -width ".Dv PHONOGRAM"
133.It Dv ENCODING
134Followed by a
135.Dv STRING
136which indicates the encoding mechanism to be used for this locale.
137The current encodings are:
138.Bl -tag -width ".Dv MSKanji"
139.It Dv ASCII
140American Standard Code for Information Interchange.
141.It Dv BIG5
142The
143.Dq Big5
144encoding of Chinese.
145.It Dv EUC
146.Dv EUC
147encoding as used by several
148vendors of
149.Ux
150systems.
151.It Dv GB18030
152PRC national standard for encoding of Chinese text.
153.It Dv GB2312
154Older PRC national standard for encoding Chinese text.
155.It Dv GBK
156A widely used encoding method for Chinese text,
157backwards compatible with GB\ 2312-1980.
158.It Dv MSKanji
159The method of encoding Japanese used by Microsoft,
160loosely based on JIS.
161Also known as
162.Dq "Shift JIS"
163and
164.Dq SJIS .
165.It Dv NONE
166No translation and the default.
167.It Dv UTF-8
168The
169.Dv UTF-8
170transformation format of
171.Tn ISO
17210646
173as defined by RFC 2279.
174.El
175.It Dv VARIABLE
176This keyword must be followed by a single tab or space character,
177after which encoding specific data is placed.
178Currently only the
179.Dv "EUC"
180encoding requires variable data.
181See
182.Xr euc 5
183for further details.
184.It Dv INVALID
185(obsolete)
186A single
187.Dv RUNE
188follows and is used as the invalid rune for this locale.
189.El
190.Pp
191The following keywords may appear multiple times and have the following
192format for data:
193.Bl -tag -width ".Dv <RUNE1 THRU RUNEn : RUNE2>" -offset indent
194.It Dv <RUNE1 RUNE2>
195.Dv RUNE1
196is mapped to
197.Dv RUNE2 .
198.It Dv <RUNE1 THRU RUNEn : RUNE2>
199Runes
200.Dv RUNE1
201through
202.Dv RUNEn
203are mapped to
204.Dv RUNE2
205through
206.Dv RUNE2
207+ n-1.
208.El
209.Bl -tag -width ".Dv PHONOGRAM"
210.It Dv MAPLOWER
211Defines the tolower mappings.
212.Dv RUNE2
213is the lower case representation of
214.Dv RUNE1 .
215.It Dv MAPUPPER
216Defines the toupper mappings.
217.Dv RUNE2
218is the upper case representation of
219.Dv RUNE1 .
220.It Dv TODIGIT
221Defines a map from runes to their digit value.
222.Dv RUNE2
223is the integer value represented by
224.Dv RUNE1 .
225For example, the ASCII character
226.Ql 0
227would map to the decimal value 0.
228Only values up to 255
229are allowed.
230.El
231.Pp
232The following keywords may appear multiple times and have the following
233format for data:
234.Bl -tag -width ".Dv RUNE1 THRU RUNEn" -offset indent
235.It Dv RUNE
236This rune has the property defined by the keyword.
237.It Dv "RUNE1 THRU RUNEn"
238All the runes between and including
239.Dv RUNE1
240and
241.Dv RUNEn
242have the property defined by the keyword.
243.El
244.Bl -tag -width ".Dv PHONOGRAM"
245.It Dv ALPHA
246Defines runes which are alphabetic, printable and graphic.
247.It Dv CONTROL
248Defines runes which are control characters.
249.It Dv DIGIT
250Defines runes which are decimal digits, printable and graphic.
251.It Dv GRAPH
252Defines runes which are graphic and printable.
253.It Dv LOWER
254Defines runes which are lower case, printable and graphic.
255.It Dv PUNCT
256Defines runes which are punctuation, printable and graphic.
257.It Dv SPACE
258Defines runes which are spaces.
259.It Dv UPPER
260Defines runes which are upper case, printable and graphic.
261.It Dv XDIGIT
262Defines runes which are hexadecimal digits, printable and graphic.
263.It Dv BLANK
264Defines runes which are blank.
265.It Dv PRINT
266Defines runes which are printable.
267.It Dv IDEOGRAM
268Defines runes which are ideograms, printable and graphic.
269.It Dv SPECIAL
270Defines runes which are special characters, printable and graphic.
271.It Dv PHONOGRAM
272Defines runes which are phonograms, printable and graphic.
273.It Dv SWIDTH0
274Defines runes with display width 0.
275.It Dv SWIDTH1
276Defines runes with display width 1.
277.It Dv SWIDTH2
278Defines runes with display width 2.
279.It Dv SWIDTH3
280Defines runes with display width 3.
281.El
282.Pp
283If no display width explicitly defined, width 1 assumed
284for printable runes by default.
285.Sh SEE ALSO
286.Xr colldef 1 ,
287.Xr setlocale 3 ,
288.Xr wcwidth 3 ,
289.Xr big5 5 ,
290.Xr euc 5 ,
291.Xr gb18030 5 ,
292.Xr gb2312 5 ,
293.Xr gbk 5 ,
294.Xr mskanji 5 ,
295.Xr utf8 5
296.Sh HISTORY
297The
298.Nm
299utility first appeared in
300.Bx 4.4 .
301.Sh BUGS
302The
303.Nm
304utility is overly simplistic.