Print this page
4116 - kiconv_open(9f): kiconv_close() in the CONTEXT section
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/man/man9f/kiconv_open.9f
+++ new/usr/src/man/man9f/kiconv_open.9f
1 1 '\" te
2 2 .\" Copyright (c) 2007, Sun Microsystems, Inc., All Rights Reserved
3 3 .\" 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.
4 4 .\" 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.
5 5 .\" 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]
6 -.TH KICONV_OPEN 9F "Oct 16, 2007"
6 +.TH KICONV_OPEN 9F "Nov 5, 2013"
7 7 .SH NAME
8 8 kiconv_open \- code conversion descriptor allocation function
9 9 .SH SYNOPSIS
10 10 .LP
11 11 .nf
12 12 #include <sys/sunddi.h>
13 13
14 14
15 15
16 16 \fBkiconv_t\fR \fBkiconv_open\fR(\fBconst\fR \fBchar *\fR\fItocode\fR, \fBconst\fR \fBchar *\fR\fIfromcode\fR);
17 17 .fi
18 18
19 19 .SH INTERFACE LEVEL
20 20 .sp
21 21 .LP
22 22 Solaris DDI specific (Solaris DDI).
23 23 .SH PARAMETERS
24 24 .sp
25 25 .ne 2
26 26 .na
27 27 \fB\fItocode\fR\fR
28 28 .ad
29 29 .RS 12n
30 30 Points to a target codeset name string.
31 31 .RE
32 32
33 33 .sp
34 34 .ne 2
35 35 .na
36 36 \fB\fIfromcode\fR\fR
37 37 .ad
38 38 .RS 12n
39 39 Points to a source codeset name string.
40 40 .RE
41 41
42 42 .SH DESCRIPTION
43 43 .sp
44 44 .LP
45 45 The \fBkiconv_open()\fR function returns a code conversion descriptor that
46 46 describes a conversion from the codeset specified by \fIfromcode\fR to the
47 47 codeset specified by \fItocode\fR. For state-dependent encodings, the
48 48 conversion descriptor is in a codeset-dependent initial state (ready for
49 49 immediate use with the \fBkiconv()\fR function).
50 50 .sp
51 51 .LP
52 52 Supported code conversions are between \fBUTF-8\fR and the following:
53 53 .sp
54 54 .in +2
55 55 .nf
56 56 Name Description
57 57
58 58 Big5 Traditional Chinese Big5
59 59 Big5-HKSCS Traditional Chinese Big5-Hong Kong
60 60 Supplementary Character Set
61 61 CP720 DOS Arabic
62 62 CP737 DOS Greek
63 63 CP850 DOS Latin-1 (Western European)
64 64 CP852 DOS Latin-2 (Eastern European)
65 65 CP857 DOS Latin-5 (Turkish)
66 66 CP862 DOS Hebrew
67 67 CP866 DOS Cyrillic Russian
68 68 CP932 Japanese Shift JIS (Windows)
69 69 CP950-HKSCS Traditional Chinese HKSCS-2001 (Windows)
70 70 CP1250 Central Europe
71 71 CP1251 Cyrillic
72 72 CP1252 Western Europe
73 73 CP1253 Greek
74 74 CP1254 Turkish
75 75 CP1255 Hebrew
76 76 CP1256 Arabic
77 77 CP1257 Baltic
78 78 EUC-CN Simplified Chinese EUC
79 79 EUC-JP Japanese EUC
80 80 EUC-JP-MS Japanese EUC MS
81 81 EUC-KR Korean EUC
82 82 EUC-TW Traditional Chinese EUC
83 83 GB18030 Simplified Chinese GB18030
84 84 GBK Simplified Chinese GBK
85 85 ISO-8859-1 Latin-1 (Western European)
86 86 ISO-8859-2 Latin-2 (Eastern European)
87 87 ISO-8859-3 Latin-3 (Southern European)
88 88 ISO-8859-4 Latin-4 (Northern European)
89 89 ISO-8859-5 Cyrillic
90 90 ISO-8859-6 Arabic
91 91 ISO-8859-7 Greek
92 92 ISO-8859-8 Hebrew
93 93 ISO-8859-9 Latin-5 (Turkish)
94 94 ISO-8859-10 Latin-6 (Nordic)
95 95 ISO-8859-13 Latin-7 (Baltic)
96 96 ISO-8859-15 Latin-9 (Western European with euro sign)
97 97 KOI8-R Cyrillic
98 98 Shift_JIS Japanese Shift JIS (JIS)
99 99 TIS_620 Thai (a.k.a. ISO 8859-11)
100 100 Unified-Hangul Korean Unified Hangul
101 101
102 102 .fi
103 103 .in -2
104 104 .sp
105 105
106 106 .sp
107 107 .LP
108 108 \fBUTF-8\fR and the above names can be used at \fItocode\fR and \fIfromcode\fR
109 109 to specify the desired code conversion. The following aliases are also
110 110 supported as alternative names to be used:
111 111 .sp
112 112 .in +2
113 113 .nf
114 114 Aliases Original Name
115 115 720 CP720
116 116 737 CP737
117 117 850 CP850
118 118 852 CP852
119 119 857 CP857
120 120 862 CP862
121 121 866 CP866
122 122 932 CP932
123 123 936, CP936 GBK
124 124 949, CP949 Unified-Hangul
125 125 950, CP950 Big5
126 126 1250 CP1250
127 127 1251 CP1251
128 128 1252 CP1252
129 129 1253 CP1253
130 130 1254 CP1254
131 131 1255 CP1255
132 132 1256 CP1256
133 133 1257 CP1257
134 134 ISO-8859-11 TIS_620
135 135 PCK, SJIS Shift_JIS
136 136 .fi
137 137 .in -2
138 138 .sp
139 139
140 140 .sp
141 141 .LP
142 142 A conversion descriptor remains valid until it is closed by using
143 143 \fBkiconv_close()\fR.
144 144 .SH RETURN VALUES
↓ open down ↓ |
128 lines elided |
↑ open up ↑ |
145 145 .sp
146 146 .LP
147 147 Upon successful completion, \fBkiconv_open()\fR returns a code conversion
148 148 descriptor for use on subsequent calls to \fBkiconv()\fR. Otherwise, if the
149 149 conversion specified by \fIfromcode\fR and \fItocode\fR is not supported or for
150 150 any other reasons the code conversion descriptor cannot be allocated,
151 151 \fBkiconv_open()\fR returns (\fBkiconv_t\fR)-1 to indicate the error.
152 152 .SH CONTEXT
153 153 .sp
154 154 .LP
155 -\fBkiconv_close()\fR can be called from user context only.
155 +\fBkiconv_open()\fR can be called from user context only.
156 156 .SH EXAMPLES
157 157 .LP
158 158 \fBExample 1 \fROpening a Code Conversion
159 159 .sp
160 160 .LP
161 161 The following example shows how to open a code conversion from \fBISO\fR
162 162 8859-15 to \fBUTF-8\fR
163 163
164 164 .sp
165 165 .in +2
166 166 .nf
167 167 #include <sys/sunddi.h>
168 168
169 169 kiconv_t cd;
170 170
171 171 cd = kiconv_open("UTF-8", "ISO-8859-15");
172 172 if (cd == (kiconv_t)-1) {
173 173 /* Cannot open up the code conversion. */
174 174 return (-1);
175 175 }
176 176 .fi
177 177 .in -2
178 178
179 179 .SH ATTRIBUTES
180 180 .sp
181 181 .LP
182 182 See \fBattributes\fR(5) for descriptions of the following attributes:
183 183 .sp
184 184
185 185 .sp
186 186 .TS
187 187 box;
188 188 c | c
189 189 l | l .
190 190 ATTRIBUTE TYPE ATTRIBUTE VALUE
191 191 _
192 192 Interface Stability Committed
193 193 .TE
194 194
195 195 .SH SEE ALSO
196 196 .sp
197 197 .LP
198 198 \fBiconv\fR(3C), \fBiconv_close\fR(3C), \fBiconv_open\fR(3C),
199 199 \fBu8_strcmp\fR(3C), \fBu8_textprep_str\fR(3C), \fBu8_validate\fR(3C),
200 200 \fBuconv_u16tou32\fR(3C), \fBuconv_u16tou8\fR(3C), \fBuconv_u32tou16\fR(3C),
201 201 \fBuconv_u32tou8\fR(3C), \fBuconv_u8tou16\fR(3C), \fBuconv_u8tou32\fR(3C),
202 202 \fBattributes\fR(5), \fBkiconv\fR(9F), \fBkiconvstr\fR(9F),
203 203 \fBkiconv_close\fR(9F), \fBu8_strcmp\fR(9F), \fBu8_textprep_str\fR(9F),
204 204 \fBu8_validate\fR(9F), \fBuconv_u16tou32\fR(9F), \fBuconv_u16tou8\fR(9F),
205 205 \fBuconv_u32tou16\fR(9F), \fBuconv_u32tou8\fR(9F), \fBuconv_u8tou16\fR(9F),
206 206 \fBuconv_u8tou32\fR(9F)
207 207 .sp
208 208 .LP
209 209 The Unicode Standard
210 210 .sp
211 211 .LP
212 212 http://www.unicode.org/standard/standard.html
213 213 .SH NOTES
214 214 .sp
215 215 .LP
216 216 The code conversions are available between \fBUTF-8\fR and the above noted
217 217 \fIcodesets\fR. For example, to convert from \fBEUC-JP \fRto \fBShift_JIS\fR,
218 218 first convert \fBEUC-JP\fR to \fBUTF-8\fR and then convert \fBUTF-8\fR to
219 219 \fBShift_JIS\fR.
220 220 .sp
221 221 .LP
222 222 The code conversions supported are based on simple one-to-one mappings. There
223 223 is no special treatment or processing done during code conversions such as case
224 224 conversion, Unicode Normalization, or mapping between combining or conjoining
225 225 sequences of \fBUTF-\fR8 and pre-composed characters in non-\fBUTF-8\fR
226 226 codesets.
227 227 .sp
228 228 .LP
229 229 All supported non-\fBUTF-8\fR codesets use pre-composed characters only.
230 230 However, \fBUTF-8\fR allows combining or conjoining characters too. For this
231 231 reason, using a form of Unicode Normalizations on \fBUTF-8\fR text with
232 232 \fBu8_textprep_str()\fR before or after doing code conversions might be
233 233 necessary.
↓ open down ↓ |
68 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX