Index: head/usr.bin/colldef/colldef.1 =================================================================== --- head/usr.bin/colldef/colldef.1 (revision 298169) +++ head/usr.bin/colldef/colldef.1 (revision 298170) @@ -1,272 +1,279 @@ .\" Copyright (c) 1995 Alex Tatmanjants .\" at Electronni Visti IA, Kiev, Ukraine. .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" -.Dd January 27, 1995 +.Dd April 18, 2016 .Dt COLLDEF 1 .Os .Sh NAME .Nm colldef .Nd convert collation sequence source definition .Sh SYNOPSIS .Nm .Op Fl I Ar map_dir .Op Fl o Ar out_file .Op Ar filename .Sh DESCRIPTION The .Nm utility converts a collation sequence source definition into a format usable by the .Fn strxfrm and .Fn strcoll functions. It is used to define the many ways in which strings can be ordered and collated. The .Fn strxfrm function transforms its first argument and places the result in its second argument. The transformed string is such that it can be correctly ordered with other transformed strings by using .Fn strcmp , .Fn strncmp , or .Fn memcmp . The .Fn strcoll function transforms its arguments and does a comparison. .Pp The .Nm utility reads the collation sequence source definition from the standard input and stores the converted definition in filename. The output file produced contains the database with collating sequence information in a form usable by system commands and routines. .Pp The following options are available: .Bl -tag -width indent .It Fl I Ar map_dir Set directory name where .Ar charmap files can be found, current directory by default. .It Fl o Ar out_file Set output file name, .Ar LC_COLLATE by default. .El .Pp The collation sequence definition specifies a set of collating elements and the rules defining how strings containing these should be ordered. This is most useful for different language definitions. .Pp The specification file can consist of three statements: .Ar charmap , .Ar substitute and .Ar order . .Pp Of these, only the .Ar order statement is required. When .Ar charmap or .Ar substitute is supplied, these statements must be ordered as above. Any statements after the order statement are ignored. .Pp Lines in the specification file beginning with a .Ql # are treated as comments and are ignored. Blank lines are also ignored. .Pp .Dl "charmap charmapfile" .Pp .Ar Charmap defines where a mapping of the character and collating element symbols to the actual character encoding can be found. .Pp The format of .Ar charmapfile is shown below. Symbol names are separated from their values by TAB or SPACE characters. Symbol-value can be specified in a hexadecimal (\ex\fI??\fR) or octal (\e\fI???\fR) representation, and can be only one character in length. .Bd -literal -offset indent symbol-name1 symbol-value1 symbol-name2 symbol-value2 \&... .Ed .Pp Symbol names cannot be specified in .Ar substitute fields. .Pp The .Ar charmap statement is optional. .Bd -literal -offset indent substitute "symbol" with "repl_string" .Ed .Pp The .Ar substitute statement substitutes the character .Ar symbol with the string .Ar repl_string . Symbol names cannot be specified in .Ar repl_string field. The .Ar substitute statement is optional. .Pp .Dl "order order_list" .Pp .Ar Order_list is a list of symbols, separated by semi colons, that defines the collating sequence. The special symbol .Ar ... specifies, in a short-hand form, symbols that are sequential in machine code order. .Pp An order list element can be represented in any one of the following ways: .Bl -bullet .It The symbol itself (for example, .Ar a for the lower-case letter .Ar a ) . .It The symbol in octal representation (for example, .Ar \e141 for the letter .Ar a ) . .It The symbol in hexadecimal representation (for example, .Ar \ex61 for the letter .Ar a ) . .It The symbol name as defined in the .Ar charmap file (for example, .Ar for .Ar letterA \e023 record in .Ar charmapfile ) . If character map name have .Ar > character, it must be escaped as .Ar /> , single .Ar / must be escaped as .Ar // . .It Symbols .Ar \ea , .Ar \eb , .Ar \ef , .Ar \en , .Ar \er , .Ar \ev are permitted in its usual C-language meaning. .It The symbol chain (for example: .Ar abc , .Ar c , .Ar \exf1b\exf2 ) .It The symbol range (for example, .Ar a;...;z ) . .It Comma-separated symbols, ranges and chains enclosed in parenthesis (for example .Ar \&( .Ar sym1 , .Ar sym2 , .Ar ... .Ar \&) ) are assigned the same primary ordering but different secondary ordering. .It Comma-separated symbols, ranges and chains enclosed in curly brackets (for example .Ar \&{ .Ar sym1 , .Ar sym2 , .Ar ... .Ar \&} ) are assigned the same primary ordering only. .El .Pp The backslash character .Ar \e is used for continuation. In this case, no characters are permitted after the backslash character. .Sh FILES .Bl -tag -width indent .It Pa /usr/share/locale/ Ns Ao Ar language Ac Ns Pa /LC_COLLATE The standard shared location for collation orders under the locale .Aq Ar language . .El .Sh EXIT STATUS The .Nm utility exits with the following values: .Bl -tag -width indent .It Li 0 No errors were found and the output was successfully created. .It Li !=0 Errors were found. .El +.Sh NOTES +.Nm +has been replaced by +.Xr localedef 1 +in +.Fx 11.0 . .Sh SEE ALSO +.Xr localedef 1 , .Xr mklocale 1 , .Xr setlocale 3 , .Xr strcoll 3 , .Xr strxfrm 3 Index: head/usr.bin/mklocale/mklocale.1 =================================================================== --- head/usr.bin/mklocale/mklocale.1 (revision 298169) +++ head/usr.bin/mklocale/mklocale.1 (revision 298170) @@ -1,304 +1,311 @@ .\" Copyright (c) 1993, 1994 .\" The Regents of the University of California. All rights reserved. .\" .\" This code is derived from software contributed to Berkeley by .\" Paul Borman at Krystal Technologies. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" 4. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" @(#)mklocale.1 8.2 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd October 17, 2004 +.Dd April 18, 2016 .Dt MKLOCALE 1 .Os .Sh NAME .Nm mklocale .Nd make LC_CTYPE locale files .Sh SYNOPSIS .Nm .Op Fl d .Ar "< src-file" .Ar "> language/LC_CTYPE" .Nm .Op Fl d .Fl o .Ar language/LC_CTYPE .Ar src-file .Sh DESCRIPTION The .Nm utility reads a .Dv LC_CTYPE source file from standard input and produces a .Dv LC_CTYPE binary file on standard output suitable for placement in .Pa /usr/share/locale/ Ns Ar language Ns Pa /LC_CTYPE . .Pp The format of .Ar src-file is quite simple. It consists of a series of lines which start with a keyword and have associated data following. C style comments are used to place comments in the file. .Pp Following options are available: .Bl -tag -width indent .It Fl d Turns on debugging messages. .It Fl o Specify output file. .El .Pp Besides the keywords which will be listed below, the following are valid tokens in .Ar src-file : .Bl -tag -width ".Ar literal" .It Dv RUNE A .Dv RUNE may be any of the following: .Bl -tag -width ".Ar 0x[0-9a-z]*" .It Ar 'x' The ASCII character .Ar x . .It Ar '\ex' The ANSI C character .Ar \ex where .Ar \ex is one of .Dv \ea , .Dv \eb , .Dv \ef , .Dv \en , .Dv \er , .Dv \et , or .Dv \ev . .It Ar 0x[0-9a-z]* A hexadecimal number representing a rune code. .It Ar 0[0-7]* An octal number representing a rune code. .It Ar [1-9][0-9]* A decimal number representing a rune code. .El .It Dv STRING A string enclosed in double quotes ("). .It Dv THRU Either .Dv ... or .Dv - . Used to indicate ranges. .It Ar literal The follow characters are taken literally: .Bl -tag -width ".Dv <\|\|(\|\|[" .It Dv "<\|(\|[" Used to start a mapping. All are equivalent. .It Dv ">\|\^)\|]" Used to end a mapping. All are equivalent. .It Dv ":" Used as a delimiter in mappings. .El .El .Pp Key words which should only appear once are: .Bl -tag -width ".Dv PHONOGRAM" .It Dv ENCODING Followed by a .Dv STRING which indicates the encoding mechanism to be used for this locale. The current encodings are: .Bl -tag -width ".Dv MSKanji" .It Dv ASCII American Standard Code for Information Interchange. .It Dv BIG5 The .Dq Big5 encoding of Chinese. .It Dv EUC .Dv EUC encoding as used by several vendors of .Ux systems. .It Dv GB18030 PRC national standard for encoding of Chinese text. .It Dv GB2312 Older PRC national standard for encoding Chinese text. .It Dv GBK A widely used encoding method for Chinese text, backwards compatible with GB\ 2312-1980. .It Dv MSKanji The method of encoding Japanese used by Microsoft, loosely based on JIS. Also known as .Dq "Shift JIS" and .Dq SJIS . .It Dv NONE No translation and the default. .It Dv UTF-8 The .Dv UTF-8 transformation format of .Tn ISO 10646 as defined by RFC 2279. .El .It Dv VARIABLE This keyword must be followed by a single tab or space character, after which encoding specific data is placed. Currently only the .Dv "EUC" encoding requires variable data. See .Xr euc 5 for further details. .It Dv INVALID (obsolete) A single .Dv RUNE follows and is used as the invalid rune for this locale. .El .Pp The following keywords may appear multiple times and have the following format for data: .Bl -tag -width ".Dv " -offset indent .It Dv .Dv RUNE1 is mapped to .Dv RUNE2 . .It Dv Runes .Dv RUNE1 through .Dv RUNEn are mapped to .Dv RUNE2 through .Dv RUNE2 + n-1. .El .Bl -tag -width ".Dv PHONOGRAM" .It Dv MAPLOWER Defines the tolower mappings. .Dv RUNE2 is the lower case representation of .Dv RUNE1 . .It Dv MAPUPPER Defines the toupper mappings. .Dv RUNE2 is the upper case representation of .Dv RUNE1 . .It Dv TODIGIT Defines a map from runes to their digit value. .Dv RUNE2 is the integer value represented by .Dv RUNE1 . For example, the ASCII character .Ql 0 would map to the decimal value 0. Only values up to 255 are allowed. .El .Pp The following keywords may appear multiple times and have the following format for data: .Bl -tag -width ".Dv RUNE1 THRU RUNEn" -offset indent .It Dv RUNE This rune has the property defined by the keyword. .It Dv "RUNE1 THRU RUNEn" All the runes between and including .Dv RUNE1 and .Dv RUNEn have the property defined by the keyword. .El .Bl -tag -width ".Dv PHONOGRAM" .It Dv ALPHA Defines runes which are alphabetic, printable and graphic. .It Dv CONTROL Defines runes which are control characters. .It Dv DIGIT Defines runes which are decimal digits, printable and graphic. .It Dv GRAPH Defines runes which are graphic and printable. .It Dv LOWER Defines runes which are lower case, printable and graphic. .It Dv PUNCT Defines runes which are punctuation, printable and graphic. .It Dv SPACE Defines runes which are spaces. .It Dv UPPER Defines runes which are upper case, printable and graphic. .It Dv XDIGIT Defines runes which are hexadecimal digits, printable and graphic. .It Dv BLANK Defines runes which are blank. .It Dv PRINT Defines runes which are printable. .It Dv IDEOGRAM Defines runes which are ideograms, printable and graphic. .It Dv SPECIAL Defines runes which are special characters, printable and graphic. .It Dv PHONOGRAM Defines runes which are phonograms, printable and graphic. .It Dv SWIDTH0 Defines runes with display width 0. .It Dv SWIDTH1 Defines runes with display width 1. .It Dv SWIDTH2 Defines runes with display width 2. .It Dv SWIDTH3 Defines runes with display width 3. .El .Pp If no display width explicitly defined, width 1 assumed for printable runes by default. +.Sh NOTES +.Nm +has been replaced by +.Xr localedef 1 +in +.Fx 11.0 . .Sh SEE ALSO .Xr colldef 1 , +.Xr localedef 1 , .Xr setlocale 3 , .Xr wcwidth 3 , .Xr big5 5 , .Xr euc 5 , .Xr gb18030 5 , .Xr gb2312 5 , .Xr gbk 5 , .Xr mskanji 5 , .Xr utf8 5 .Sh HISTORY The .Nm utility first appeared in .Bx 4.4 . .Sh BUGS The .Nm utility is overly simplistic.