1.\" $NetBSD: mklocale.1,v 1.15 2010/05/14 17:23:13 joerg Exp $ 2.\" FreeBSD: src/usr.bin/mklocale/mklocale.1,v 1.6 1999/09/20 09:15:21 phantom Exp 3.\" 4.\" Copyright (c) 1993, 1994 5.\" The Regents of the University of California. All rights reserved. 6.\" 7.\" This code is derived from software contributed to Berkeley by 8.\" Paul Borman at Krystal Technologies. 9.\" 10.\" Redistribution and use in source and binary forms, with or without 11.\" modification, are permitted provided that the following conditions 12.\" are met: 13.\" 1. Redistributions of source code must retain the above copyright 14.\" notice, this list of conditions and the following disclaimer. 15.\" 2. Redistributions in binary form must reproduce the above copyright 16.\" notice, this list of conditions and the following disclaimer in the 17.\" documentation and/or other materials provided with the distribution. 18.\" 3. Neither the name of the University nor the names of its contributors 19.\" may be used to endorse or promote products derived from this software 20.\" without specific prior written permission. 21.\" 22.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 23.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 24.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 26.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 27.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 28.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32.\" SUCH DAMAGE. 33.\" 34.\" @(#)mklocale.1 8.2 (Berkeley) 4/18/94 35.\" 36.Dd January 2, 2009 37.Dt MKLOCALE 1 38.Os 39.Sh NAME 40.Nm mklocale 41.Nd make LC_CTYPE locale files 42.Sh SYNOPSIS 43.Nm mklocale 44.Op Fl d 45.Op Fl t Ar type 46\*[Lt] 47.Ar source 48\*[Gt] 49.Ar language/LC_CTYPE 50.Nm mklocale 51.Op Fl d 52.Op Fl t Ar type 53.Fl o 54.Ar language/LC_CTYPE 55.Ar source 56.Sh DESCRIPTION 57The 58.Nm mklocale 59utility reads an 60.Dv LC_CTYPE 61source file from standard input and produces an 62.Dv LC_CTYPE 63binary file on standard output suitable for placement in 64.Pa /usr/share/locale/\*[Lt]language\*[Gt]/LC_CTYPE . 65.Pp 66The format of 67.Ar source 68is quite simple. 69It consists of a series of lines which start with a keyword and have 70associated data following. 71C style comments are used 72to place comments in the file. 73.Pp 74Following options are available: 75.Bl -tag -width XXX 76.It Fl d 77Turns on debugging messages. 78.It Fl o 79Specify output file. 80.It Fl t 81Generate output in new-style LC_{MONETARY,NUMERIC,TIME,MESSAGES} 82locale-db format. 83.El 84.Pp 85Besides the keywords which will be listed below, 86the following are valid tokens in 87.Ar source : 88.Bl -tag -width literal 89.It Dv RUNE 90A 91.Dv RUNE 92may be any of the following: 93.Bl -tag -width 0x[0-9a-z]* 94.It Ar 'x' 95The ASCII character 96.Ar x . 97.It Ar '\ex' 98The ANSI C character 99.Ar \ex 100where 101.Ar \ex 102is one of 103.Dv \ea , 104.Dv \eb , 105.Dv \ef , 106.Dv \en , 107.Dv \er , 108.Dv \et , 109or 110.Dv \ev . 111.It Ar 0x[0-9a-z]* 112A hexadecimal number representing a rune code. 113.It Ar 0[0-7]* 114An octal number representing a rune code. 115.It Ar [1-9][0-9]* 116A decimal number representing a rune code. 117.El 118.It Dv STRING 119A string enclosed in double quotes ("). 120.It Dv THRU 121Either 122.Dv ... 123or 124.Dv - . 125Used to indicate ranges. 126.It Ar literal 127The follow characters are taken literally: 128.Bl -tag -width "\*[Lt]\|\|(\|\|[" 129.It Dv "\*[Lt]\|(\|[" 130Used to start a mapping. 131All are equivalent. 132.It Dv "\*[Gt]\|\^)\|]" 133Used to end a mapping. 134All are equivalent. 135.It Dv \&: 136Used as a delimiter in mappings. 137.El 138.El 139.Pp 140Key words which should only appear once are: 141.Bl -tag -width PHONOGRAM 142.It Dv ENCODING 143Followed by a 144.Dv STRING 145which indicates the encoding mechanism to be used for this locale. 146The current encodings are: 147.Bl -tag -width NONE 148.It Dv NONE 149No translation and the default. 150.It Dv UTF2 151.Dv "Universal character set Transformation Format" 152adopted from 153.Nm "Plan 9 from Bell Labs" . 154.It Dv EUC 155.Dv EUC 156encoding as used by several 157vendors of 158.Ux 159systems. 160.El 161.It Dv VARIABLE 162This keyword must be followed by a single tab or space character, 163after which encoding specific data is placed. 164Currently only the 165.Dv "EUC" 166encoding requires variable data. 167.\" See 168.\" .Xr euc 4 169.\" for further details. 170.It Dv INVALID 171A single 172.Dv RUNE 173follows and is used as the invalid rune for this locale. 174.El 175.Pp 176The following keywords may appear multiple times and have the following 177format for data: 178.Bl -tag -width "XXRUNE1 THRU RUNEn : RUNE2XX" -offset indent 179.It Aq Dv RUNE1 RUNE2 180.Dv RUNE1 181is mapped to 182.Dv RUNE2 . 183.It Aq Dv RUNE1 THRU RUNEn : RUNE2 184Runes 185.Dv RUNE1 186through 187.Dv RUNEn 188are mapped to 189.Dv RUNE2 190through 191.Dv RUNE2 192+ n-1. 193.El 194.Bl -tag -width PHONOGRAM 195.It Dv MAPLOWER 196Defines the tolower mappings. 197.Dv RUNE2 198is the lower case representation of 199.Dv RUNE1 . 200.It Dv MAPUPPER 201Defines the toupper mappings. 202.Dv RUNE2 203is the upper case representation of 204.Dv RUNE1 . 205.It Dv TODIGIT 206Defines a map from runes to their digit value. 207.Dv RUNE2 208is the integer value represented by 209.Dv RUNE1 . 210For example, the ASCII character 211.Sq 0 212would map to the decimal value 0. 213Only values up to 255 are allowed. 214.El 215.Pp 216The following keywords may appear multiple times and have the following 217format for data: 218.Bl -tag -width "RUNE1 THRU RUNEn" 219.It Dv RUNE 220This rune has the property defined by the keyword. 221.It Dv "RUNE1 THRU RUNEn" 222All the runes between and including 223.Dv RUNE1 224and 225.Dv RUNEn 226have the property defined by the keyword. 227.El 228.Bl -tag -width PHONOGRAM 229.It Dv ALPHA 230Defines runes which are alphabetic, printable, and graphic. 231.It Dv CONTROL 232Defines runes which are control characters. 233.It Dv DIGIT 234Defines runes which are decimal digits, printable, and graphic. 235.It Dv GRAPH 236Defines runes which are graphic and printable. 237.It Dv LOWER 238Defines runes which are lower case, printable, and graphic. 239.It Dv PUNCT 240Defines runes which are punctuation, printable, and graphic. 241.It Dv SPACE 242Defines runes which are spaces. 243.It Dv UPPER 244Defines runes which are upper case, printable, and graphic. 245.It Dv XDIGIT 246Defines runes which are hexadecimal digits, printable, and graphic. 247.It Dv BLANK 248Defines runes which are blank. 249.It Dv PRINT 250Defines runes which are printable. 251.It Dv IDEOGRAM 252Defines runes which are ideograms, printable, and graphic. 253.It Dv SPECIAL 254Defines runes which are special characters, printable, and graphic. 255.It Dv PHONOGRAM 256Defines runes which are phonograms, printable, and graphic. 257.It Dv SWIDTHn 258Defines runes with specific glyph width. 259.Ar n 260takes 0 to 3. 261.It Dv CHARSET 262Controls character set for subsequent runes. 263.\" To support 264.\" .Xr iso2022 4 265.\" locale definitions. 266.El 267.Sh SEE ALSO 268.\"Xr colldef 1 , 269.Xr setlocale 3 , 270.\" .Xr euc 4 , 271.\" .Xr utf8 4 272.Xr nls 7 273.Sh HISTORY 274The 275.Nm mklocale 276utility first appeared in 277.Bx 4.4 . 278.Sh BUGS 279The 280.Nm mklocale 281utility is overly simplistic. 282.Pp 283We should switch to 284.Nm localedef 285and its file format, which is more standard. 286