ccbe71910ebf76f1a35bda7d5801339133b9917a
[dragonfly.git] / share / man / man5 / utf2.5
1 .\" Copyright (c) 1993
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 .\" 3. 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 .\"     @(#)utf2.4      8.1 (Berkeley) 6/4/93
32 .\" $FreeBSD: src/lib/libc/locale/utf2.4,v 1.8.2.2 2002/10/24 11:00:52 tjr Exp $
33 .\" $DragonFly: src/share/man/man5/utf2.5,v 1.3 2005/03/24 12:48:04 swildner Exp $
34 .\"
35 .Dd October 11, 2002
36 .Dt UTF2 5
37 .Os
38 .Sh NAME
39 .Nm utf2
40 .Nd "Universal character set Transformation Format encoding of runes"
41 .Sh SYNOPSIS
42 .Nm ENCODING
43 .Qq UTF2
44 .Sh DESCRIPTION
45 .Bf Em
46 The UTF2 encoding has been deprecated in favour of UTF-8.
47 .Ef
48 New applications should not use UTF2.
49 .Pp
50 The
51 .Nm UTF2
52 encoding is based on a proposed X-Open multibyte
53 \s-1FSS-UCS-TF\s+1 (File System Safe Universal Character Set Transformation Format) encoding as used in
54 .Sy "Plan 9 from Bell Labs" .
55 Although it is capable of representing more than 16 bits,
56 the current implementation is limited to 16 bits as defined by the
57 Unicode Standard.
58 .Pp
59 .Nm UTF2
60 representation is backwards compatible with ASCII, so 0x00-0x7f refer to the
61 ASCII character set.  The multibyte encoding of runes between 0x0080 and 0xffff
62 consist entirely of bytes whose high order bit is set.  The actual
63 encoding is represented by the following table:
64 .Bd -literal
65 [0x0000 - 0x007f] [00000000.0bbbbbbb] -> 0bbbbbbb
66 [0x0080 - 0x07ff] [00000bbb.bbbbbbbb] -> 110bbbbb, 10bbbbbb
67 [0x0800 - 0xffff] [bbbbbbbb.bbbbbbbb] -> 1110bbbb, 10bbbbbb, 10bbbbbb
68 .Ed
69 .Pp
70 If more than a single representation of a value exists (for example,
71 0x00; 0xC0 0x80; 0xE0 0x80 0x80) the shortest representation is always
72 used (but the longer ones will be correctly decoded).
73 .Pp
74 The final three encodings provided by X-Open:
75 .Bd -literal
76 [00000000.000bbbbb.bbbbbbbb.bbbbbbbb] ->
77         11110bbb, 10bbbbbb, 10bbbbbb, 10bbbbbb
78
79 [000000bb.bbbbbbbb.bbbbbbbb.bbbbbbbb] ->
80         111110bb, 10bbbbbb, 10bbbbbb, 10bbbbbb, 10bbbbbb
81
82 [0bbbbbbb.bbbbbbbb.bbbbbbbb.bbbbbbbb] ->
83         1111110b, 10bbbbbb, 10bbbbbb, 10bbbbbb, 10bbbbbb, 10bbbbbb
84 .Ed
85 .Pp
86 which provides for the entire proposed ISO-10646 31 bit standard are currently
87 not implemented.
88 .Sh "SEE ALSO"
89 .Xr mklocale 1 ,
90 .Xr setlocale 3 ,
91 .Xr utf8 5