File size: 9,377 Bytes
651c7e5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
<!-- Creator     : groff version 1.22.3 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta name="generator" content="groff -Thtml, see www.gnu.org">
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta name="Content-Style" content="text/css">
<style type="text/css">
       p       { margin-top: 0; margin-bottom: 0; vertical-align: top }
       pre     { margin-top: 0; margin-bottom: 0; vertical-align: top }
       table   { margin-top: 0; margin-bottom: 0; vertical-align: top }
       h1      { text-align: center }
</style>
<title>ICONV_OPEN</title>

</head>
<body>

<h1 align="center">ICONV_OPEN</h1>

<a href="#NAME">NAME</a><br>
<a href="#SYNOPSIS">SYNOPSIS</a><br>
<a href="#DESCRIPTION">DESCRIPTION</a><br>
<a href="#RETURN VALUE">RETURN VALUE</a><br>
<a href="#ERRORS">ERRORS</a><br>
<a href="#CONFORMING TO">CONFORMING TO</a><br>
<a href="#SEE ALSO">SEE ALSO</a><br>

<hr>


<h2>NAME
<a name="NAME"></a>
</h2>


<p style="margin-left:11%; margin-top: 1em">iconv_open
&minus; allocate descriptor for character set conversion</p>

<h2>SYNOPSIS
<a name="SYNOPSIS"></a>
</h2>


<p style="margin-left:11%; margin-top: 1em"><b>#include
&lt;iconv.h&gt;</b></p>

<p style="margin-left:11%; margin-top: 1em"><b>iconv_t
iconv_open (const char*</b> <i>tocode</i><b>, const
char*</b> <i>fromcode</i><b>);</b></p>

<h2>DESCRIPTION
<a name="DESCRIPTION"></a>
</h2>


<p style="margin-left:11%; margin-top: 1em">The
<b>iconv_open</b> function allocates a conversion descriptor
suitable for converting byte sequences from character
encoding <i>fromcode</i> to character encoding
<i>tocode</i>.</p>

<p style="margin-left:11%; margin-top: 1em">The values
permitted for <i>fromcode</i> and <i>tocode</i> and the
supported combinations are system dependent. For the
libiconv library, the following encodings are supported, in
all combinations. <br>
European languages</p>

<p style="margin-left:22%;">ASCII,
ISO&minus;8859&minus;{1,2,3,4,5,7,9,10,13,14,15,16},
KOI8&minus;R, KOI8&minus;U, KOI8&minus;RU,
CP{1250,1251,1252,1253,1254,1257}, CP{850,866,1131},
Mac{Roman,CentralEurope,Iceland,Croatian,Romania},
Mac{Cyrillic,Ukraine,Greek,Turkish}, Macintosh</p>

<p style="margin-left:11%;">Semitic languages</p>

<p style="margin-left:22%;">ISO&minus;8859&minus;{6,8},
CP{1255,1256}, CP862, Mac{Hebrew,Arabic}</p>

<p style="margin-left:11%;">Japanese</p>

<p style="margin-left:22%;">EUC&minus;JP, SHIFT_JIS, CP932,
ISO&minus;2022&minus;JP, ISO&minus;2022&minus;JP&minus;2,
ISO&minus;2022&minus;JP&minus;1,
ISO-2022&minus;JP&minus;MS</p>

<p style="margin-left:11%;">Chinese</p>

<p style="margin-left:22%;">EUC&minus;CN, HZ, GBK, CP936,
GB18030, GB18030:2022, EUC&minus;TW, BIG5, CP950,
BIG5&minus;HKSCS, BIG5&minus;HKSCS:2004,
BIG5&minus;HKSCS:2001, BIG5&minus;HKSCS:1999,
ISO&minus;2022&minus;CN,
ISO&minus;2022&minus;CN&minus;EXT</p>

<table width="100%" border="0" rules="none" frame="void"
       cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="11%"></td>
<td width="9%">


<p>Korean</p></td>
<td width="2%"></td>
<td width="50%">


<p>EUC&minus;KR, CP949, ISO&minus;2022&minus;KR, JOHAB</p></td>
<td width="28%">
</td></tr>
</table>

<p style="margin-left:11%;">Armenian</p>

<p style="margin-left:22%;">ARMSCII&minus;8</p>

<p style="margin-left:11%;">Georgian</p>

<p style="margin-left:22%;">Georgian&minus;Academy,
Georgian&minus;PS</p>

<table width="100%" border="0" rules="none" frame="void"
       cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="11%"></td>
<td width="9%">


<p>Tajik</p></td>
<td width="2%"></td>
<td width="35%">


<p>KOI8&minus;T</p></td>
<td width="43%">
</td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="9%">


<p>Kazakh</p></td>
<td width="2%"></td>
<td width="35%">


<p>PT154, RK1048</p></td>
<td width="43%">
</td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="9%">


<p>Thai</p></td>
<td width="2%"></td>
<td width="35%">


<p>TIS&minus;620, CP874, MacThai</p></td>
<td width="43%">
</td></tr>
</table>

<p style="margin-left:11%;">Laotian</p>

<p style="margin-left:22%;">MuleLao&minus;1, CP1133</p>

<p style="margin-left:11%;">Vietnamese</p>

<p style="margin-left:22%;">VISCII, TCVN, CP1258</p>

<p style="margin-left:11%;">Platform specifics</p>

<p style="margin-left:22%;">HP&minus;ROMAN8, NEXTSTEP</p>

<p style="margin-left:11%;">Full Unicode</p>

<p style="margin-left:22%;">UTF&minus;8 <br>
UCS&minus;2, UCS&minus;2BE, UCS&minus;2LE <br>
UCS&minus;4, UCS&minus;4BE, UCS&minus;4LE <br>
UTF&minus;16, UTF&minus;16BE, UTF&minus;16LE <br>
UTF&minus;32, UTF&minus;32BE, UTF&minus;32LE <br>
UTF&minus;7 <br>
C99, JAVA</p>

<p style="margin-left:11%;">Full Unicode, in terms of
<b>uint16_t</b> or <b>uint32_t</b></p>

<p style="margin-left:22%;">(with machine dependent
endianness and alignment) <br>
UCS&minus;2&minus;INTERNAL, UCS&minus;4&minus;INTERNAL</p>

<p style="margin-left:11%;">Locale dependent, in terms of
<b>char</b> or <b>wchar_t</b></p>

<p style="margin-left:22%;">(with machine dependent
endianness and alignment, and with semantics depending on
the OS and the current LC_CTYPE locale facet) <br>
char, wchar_t</p>

<p style="margin-left:11%; margin-top: 1em">When configured
with the option
<b>&minus;&minus;enable&minus;extra&minus;encodings</b>, it
also provides support for a few extra encodings: <br>
European languages</p>


<p style="margin-left:22%;">CP{437,737,775,852,853,855,857,858,860,861,863,865,869,1125}</p>

<p style="margin-left:11%;">Semitic languages</p>

<p style="margin-left:22%;">CP864</p>

<p style="margin-left:11%;">Japanese</p>

<p style="margin-left:22%;">EUC&minus;JISX0213,
Shift_JISX0213, ISO&minus;2022&minus;JP&minus;3</p>

<p style="margin-left:11%;">Chinese</p>

<p style="margin-left:22%;">BIG5&minus;2003
(experimental)</p>

<p style="margin-left:11%;">Turkmen</p>

<p style="margin-left:22%;">TDS565</p>

<p style="margin-left:11%;">Platform specifics</p>

<p style="margin-left:22%;">ATARIST,
RISCOS&minus;LATIN1</p>

<p style="margin-left:11%;">EBCDIC compatible (not ASCII
compatible, very rarely used)</p>

<p style="margin-left:22%;">European languages: <br>

IBM-{037,273,277,278,280,282,284,285,297,423,500,870,871,875,880},
<br>

IBM-{905,924,1025,1026,1047,1112,1122,1123,1140,1141,1142,1143},
<br>

IBM-{1144,1145,1146,1147,1148,1149,1153,1154,1155,1156,1157,1158},
<br>
IBM-{1165,1166,4971} <br>
Semitic languages: <br>
IBM-{424,425,12712,16804} <br>
Persian: <br>
IBM-1097 <br>
Thai: <br>
IBM-{838,1160} <br>
Laotian: <br>
IBM-1132 <br>
Vietnamese: <br>
IBM-{1130,1164} <br>
Indic languages: <br>
IBM-1137</p>

<p style="margin-left:11%; margin-top: 1em">The empty
encoding name &quot;&quot; is equivalent to
&quot;char&quot;: it denotes the locale dependent character
encoding.</p>

<p style="margin-left:11%; margin-top: 1em">When the string
&quot;//TRANSLIT&quot; is appended to <i>tocode</i>,
transliteration is activated. This means that when a
character cannot be represented in the target character set,
it can be approximated through one or several characters
that look similar to the original character.</p>

<p style="margin-left:11%; margin-top: 1em">When the string
&quot;//IGNORE&quot; is appended to <i>tocode</i>, invalid
multibyte sequences in the input and characters that cannot
be represented in the target character set will be silently
discarded.</p>

<p style="margin-left:11%; margin-top: 1em">When the string
&quot;//NON_IDENTICAL_DISCARD&quot; is appended to
<i>tocode</i>, characters that cannot be represented in the
target character set will be silently discarded.</p>

<p style="margin-left:11%; margin-top: 1em">The resulting
conversion descriptor can be used with <b>iconv</b> any
number of times. It remains valid until deallocated using
<b>iconv_close</b>.</p>

<p style="margin-left:11%; margin-top: 1em">A conversion
descriptor contains a conversion state. After creation using
<b>iconv_open</b>, the state is in the initial state. Using
<b>iconv</b> modifies the descriptor&rsquo;s conversion
state. (This implies that a conversion descriptor can not be
used in multiple threads simultaneously.) To bring the state
back to the initial state, use <b>iconv</b> with NULL as
<i>inbuf</i> argument.</p>

<h2>RETURN VALUE
<a name="RETURN VALUE"></a>
</h2>


<p style="margin-left:11%; margin-top: 1em">The
<b>iconv_open</b> function returns a freshly allocated
conversion descriptor. In case of error, it sets
<b>errno</b> and returns (iconv_t)(&minus;1).</p>

<h2>ERRORS
<a name="ERRORS"></a>
</h2>


<p style="margin-left:11%; margin-top: 1em">The following
error can occur, among others:</p>

<table width="100%" border="0" rules="none" frame="void"
       cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="11%"></td>
<td width="9%">


<p><b>EINVAL</b></p></td>
<td width="2%"></td>
<td width="78%">


<p>The conversion from <i>fromcode</i> to <i>tocode</i> is
not supported by the implementation.</p></td></tr>
</table>

<h2>CONFORMING TO
<a name="CONFORMING TO"></a>
</h2>


<p style="margin-left:11%; margin-top: 1em">POSIX:2024</p>

<h2>SEE ALSO
<a name="SEE ALSO"></a>
</h2>



<p style="margin-left:11%; margin-top: 1em"><b>iconv</b>(3)
<b>iconvctl</b>(3) <b>iconv_close</b>(3)</p>
<hr>
</body>
</html>