]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - lib/libkiconv/kiconv.3
Remove $FreeBSD$: two-line nroff pattern
[FreeBSD/FreeBSD.git] / lib / libkiconv / kiconv.3
1 .\"
2 .\" Copyright (c) 2003 Ryuichiro Imura
3 .\" All rights reserved.
4 .\"
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
7 .\" are met:
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\"    notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\"    notice, this list of conditions and the following disclaimer in the
12 .\"    documentation and/or other materials provided with the distribution.
13 .\"
14 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 .\" SUCH DAMAGE.
25 .\"
26 .Dd July 17, 2003
27 .Dt KICONV 3
28 .Os
29 .Sh NAME
30 .Nm kiconv_add_xlat16_cspair ,
31 .Nm kiconv_add_xlat16_cspairs ,
32 .Nm kiconv_add_xlat16_table
33 .Nd kernel side iconv library
34 .Sh LIBRARY
35 .Lb libkiconv
36 .Sh SYNOPSIS
37 .In sys/iconv.h
38 .Ft int
39 .Fo kiconv_add_xlat16_cspair
40 .Fa "const char *tocode"
41 .Fa "const char *fromcode"
42 .Fa "int flag"
43 .Fc
44 .Ft int
45 .Fo kiconv_add_xlat16_cspairs
46 .Fa "const char *foreigncode"
47 .Fa "const char *localcode"
48 .Fc
49 .Ft int
50 .Fo kiconv_add_xlat16_table
51 .Fa "const char *tocode"
52 .Fa "const char *fromcode"
53 .Fa "const void *data"
54 .Fa "int datalen"
55 .Fc
56 .Sh DESCRIPTION
57 The
58 .Nm kiconv
59 library provides multi-byte character conversion tables for kernel side
60 iconv service.
61 .Pp
62 The
63 .Fn kiconv_add_xlat16_cspair
64 function
65 defines a conversion table using
66 .Xr iconv 3
67 between
68 .Fa fromcode
69 charset and
70 .Fa tocode
71 charset.
72 You can specify
73 .Fa flag
74 to determine if
75 .Xr tolower 3
76 /
77 .Xr toupper 3
78 conversion is included in the table.
79 The
80 .Fa flag
81 has following values.
82 .Pp
83 .Bl -tag -width ".Dv KICONV_FROM_LOWER" -compact
84 .It Dv KICONV_LOWER
85 .It Dv KICONV_FROM_LOWER
86 It generates a tolower table in addition to a character conversion table.
87 The difference between two is tolower
88 .Fa tocode
89 or tolower
90 .Fa fromcode .
91 .It Dv KICONV_UPPER
92 .It Dv KICONV_FROM_UPPER
93 It generates a toupper table in addition to a character conversion table.
94 The difference between two is toupper
95 .Fa tocode
96 or toupper
97 .Fa fromcode .
98 .El
99 .Pp
100 A tolower/toupper conversion is limited to single-byte characters.
101 .Pp
102 The
103 .Fn kiconv_add_xlat16_cspairs
104 function
105 defines two conversion tables which are from
106 .Fa localcode
107 to
108 .Fa foreigncode
109 and from
110 .Fa foreigncode
111 to
112 .Fa localcode .
113 These conversion tables also contain both tolower and toupper tables.
114 .Pp
115 The
116 .Fn kiconv_add_xlat16_table
117 function
118 defines a conversion table directly pointed by
119 .Fa data
120 whose length is
121 .Fa datalen ,
122 not using
123 .Xr iconv 3 .
124 .Sh SEE ALSO
125 .Xr iconv 3 ,
126 .Xr tolower 3 ,
127 .Xr toupper 3