2 .\" Copyright (c) 1992, X/Open Company Limited All Rights Reserved Portions Copyright (c) 2003, Sun Microsystems, Inc. All Rights Reserved
3 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
4 .\" http://www.opengroup.org/bookstore/.
5 .\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
6 .\" This notice shall appear on any product containing this material.
7 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
8 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
9 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
10 .TH CHARMAP 5 "Dec 1, 2003"
12 charmap \- character set description file
16 A character set description file or \fIcharmap\fR defines characteristics for a
17 coded character set. Other information about the coded character set may also
18 be in the file. Coded character set character values are defined using symbolic
19 character names followed by character encoding values.
22 The character set description file provides:
27 The capability to describe character set attributes (such as collation order or
28 character classes) independent of character set encoding, and using only the
29 characters in the portable character set. This makes it possible to create
30 generic \fBlocaledef\fR(1) source files for all codesets that share the
31 portable character set.
37 Standardized symbolic names for all characters in the portable character set,
38 making it possible to refer to any such character regardless of encoding.
43 Each symbolic name is included in the file and is mapped to a unique encoding
44 value (except for those symbolic names that are shown with identical glyphs).
45 If the control characters commonly associated with the symbolic names in the
46 following table are supported by the implementation, the symbolic names and
47 their corresponding encoding values are included in the file. Some of the
48 encodings associated with the symbolic names in this table may be the same as
49 characters in the portable character set table.
57 <ACK> <DC2> <ENQ> <FS> <IS4> <SOH>
58 <BEL> <DC3> <EOT> <GS> <LF> <STX>
59 <BS> <DC4> <ESC> <HT> <NAK> <SUB>
60 <CAN> <DEL> <ETB> <IS1> <RS> <SYN>
61 <CR> <DLE> <ETX> <IS2> <SI> <US>
62 <DC1> <EM> <FF> <IS3> <SO> <VT>
68 The following declarations can precede the character definitions. Each must
69 consist of the symbol shown in the following list, starting in column 1,
70 including the surrounding brackets, followed by one or more blank characters,
71 followed by the value to be assigned to the symbol.
75 \fB<\fIcode_set_name\fR>\fR
78 The name of the coded character set for which the character set description
85 \fB<\fImb_cur_max\fR>\fR
88 The maximum number of bytes in a multi-byte character. This defaults to
95 \fB<\fImb_cur_min\fR>\fR
98 An unsigned positive integer value that defines the minimum number of bytes in
99 a character for the encoded character set.
105 \fB<\fIescape_char\fR>\fR
108 The escape character used to indicate that the characters following will be
109 interpreted in a special way, as defined later in this section. This defaults
110 to backslash ('\fB\e\fR\&'), which is the character glyph used in all the
111 following text and examples, unless otherwise noted.
117 \fB<\fIcomment_char\fR>\fR
120 The character that when placed in column 1 of a charmap line, is used to
121 indicate that the line is to be ignored. The default character is the number
128 The character set mapping definitions will be all the lines immediately
129 following an identifier line containing the string \fBCHARMAP\fR starting in
130 column 1, and preceding a trailer line containing the string \fBEND\fR
131 \fBCHARMAP\fR starting in column 1. Empty lines and lines containing a
132 \fI<comment_char>\fR in the first column will be ignored. Each non-comment line
133 of the character set mapping definition, that is, between the \fBCHARMAP\fR and
134 \fBEND CHARMAP\fR lines of the file), must be in either of two forms:
138 \fB"%s %s %s\en",\fR<\fIsymbolic-name\fR>,<\fIencoding\fR>,<\fIcomments\fR>
148 \fB"%s...%s %s %s\en",\fR<\fIsymbolic-name\fR>,<\fIsymbolic-name\fR>, <\fIencoding\fR>,\e
155 In the first format, the line in the character set mapping definition defines a
156 single symbolic name and a corresponding encoding. A character following an
157 escape character is interpreted as itself; for example, the sequence
158 "<\fB\e\e\e\fR>>" represents the symbolic name "\fI\e>\fR" enclosed between
162 In the second format, the line in the character set mapping definition defines
163 a range of one or more symbolic names. In this form, the symbolic names must
164 consist of zero or more non-numeric characters, followed by an integer formed
165 by one or more decimal digits. The characters preceding the integer must be
166 identical in the two symbolic names, and the integer formed by the digits in
167 the second symbolic name must be equal to or greater than the integer formed by
168 the digits in the first name. This is interpreted as a series of symbolic names
169 formed from the common part and each of the integers between the first and the
170 second integer, inclusive. As an example, \fB<j0101>...<j0104>\fR is
171 interpreted as the symbolic names \fB<j0101>\fR, \fB<j0102>\fR, \fB<j0103>\fR,
172 and \fB<j0104>\fR, in that order.
175 A character set mapping definition line must exist for all symbolic names and
176 must define the coded character value that corresponds to the character glyph
177 indicated in the table, or the coded character value that corresponds with the
178 control character symbolic name. If the control characters commonly associated
179 with the symbolic names are supported by the implementation, the symbolic name
180 and the corresponding encoding value must be included in the file. Additional
181 unique symbolic names may be included. A coded character value can be
182 represented by more than one symbolic name.
185 The encoding part is expressed as one (for single-byte character values) or
186 more concatenated decimal, octal or hexadecimal constants in the following
191 \fB"%cd%d",\fR<\fIescape_char\fR>,<\fIdecimal byte value\fR>
193 \fB"%cx%x",\fR<\fIescape_char\fR>,<\fIhexadecimal byte value\fR>
195 \fB"%c%o",\fR<\fIescape_char\fR>,<\fIoctal byte value\fR>
199 .SS "Decimal Constants"
202 Decimal constants must be represented by two or three decimal digits, preceded
203 by the escape character and the lower-case letter \fBd\fR; for example,
204 \fB\ed05\fR, \fB\ed97\fR, or \fB\ed143\fR\&. Hexadecimal constants must be
205 represented by two hexadecimal digits, preceded by the escape character and the
206 lower-case letter \fBx\fR; for example, \fB\ex05\fR, \fB\ex61\fR, or
207 \fB\ex8f\fR\&. Octal constants must be represented by two or three octal
208 digits, preceded by the escape character; for example, \fB\e05\fR, \fB\e141\fR,
209 or \fB\e217\fR\&. In a portable charmap file, each constant must represent an
210 8-bit byte. Implementations supporting other byte sizes may allow constants to
211 represent values larger than those that can be represented in 8-bit bytes, and
212 to allow additional digits in constants. When constants are concatenated for
213 multi-byte character values, they must be of the same type, and interpreted in
214 byte order from first to last with the least significant byte of the multi-byte
215 character specified by the last constant.
216 .SS "Ranges of Symbolic Names"
219 In lines defining ranges of symbolic names, the encoded value is the value for
220 the first symbolic name in the range (the symbolic name preceding the
221 ellipsis). Subsequent symbolic names defined by the range will have encoding
222 values in increasing order. Bytes are treated as unsigned octets and carry is
223 propagated between the bytes as necessary to represent the range. However,
224 because this causes a null byte in the second or subsequent bytes of a
225 character, such a declaration should not be specified. For example, the line
229 <j0101>...<j0104> \ed129\ed254
248 The expanded declaration of the symbol \fB<j0103>\fR in the above example is an
249 invalid specification, because it contains a null byte in the second byte of a
253 The comment is optional.
254 .SS "Width Specification"
257 The following declarations can follow the character set mapping definitions
258 (after the "\fBEND CHARMAP\fR" statement). Each consists of the keyword shown
259 in the following list, starting in column 1, followed by the value(s) to be
260 associated to the keyword, as defined below.
267 A non-negative integer value defining the column width for the printable
268 character in the coded character set mapping definitions. Coded character set
269 character values are defined using symbolic character names followed by column
270 width values. Defining a character with more than one \fBWIDTH\fR produces
271 undefined results. The \fBEND WIDTH\fR keyword is used to terminate the
272 \fBWIDTH\fR definitions. Specifying the width of a non-printable character in a
273 \fBWIDTH\fR declaration produces undefined results.
279 \fB\fBWIDTH_DEFAULT\fR\fR
282 A non-negative integer value defining the default column width for any
283 printable character not listed by one of the \fBWIDTH\fR keywords. If no
284 \fBWIDTH_DEFAULT\fR keyword is included in the charmap, the default character
293 After the "\fBEND CHARMAP\fR" statement, a syntax for a width definition would
312 In this example, the numerical code point values represented by the symbols
313 \fB<A>\fR and \fB<B>\fR are assigned a width of \fB1\fR. The code point values
314 \fB< C>\fR to \fB<Z>\fR inclusive, that is, \fB<C>\fR, \fB<D>\fR, \fB<E>\fR,
315 and so on, are also assigned a width of \fB1\fR. Using \fB<A>. . .<Z>\fR would
316 have required fewer lines, but the alternative was shown to demonstrate
317 flexibility. The keyword \fBWIDTH_DEFAULT\fR could have been added as
322 \fBlocale\fR(1), \fBlocaledef\fR(1), \fBnl_langinfo\fR(3C),
323 \fBextensions\fR(5), \fBlocale\fR(5)