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