source: trunk/third/libiconv/man/iconv_open.3 @ 18195

Revision 18195, 4.3 KB checked in by ghudson, 22 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r18194, which included commits to RCS files with non-trunk default branches.
Line 
1.\" Copyright (c) Bruno Haible <bruno@clisp.org>
2.\"
3.\" This is free documentation; you can redistribute it and/or
4.\" modify it under the terms of the GNU General Public License as
5.\" published by the Free Software Foundation; either version 2 of
6.\" the License, or (at your option) any later version.
7.\"
8.\" References consulted:
9.\"   GNU glibc-2 source code and manual
10.\"   OpenGroup's Single Unix specification http://www.UNIX-systems.org/online.html
11.\"
12.TH ICONV_OPEN 3  "May 26, 2002" "GNU" "Linux Programmer's Manual"
13.SH NAME
14iconv_open \- allocate descriptor for character set conversion
15.SH SYNOPSIS
16.nf
17.B #include <iconv.h>
18.sp
19.BI "iconv_t iconv_open (const char* " tocode ", const char* " fromcode );
20.fi
21.SH DESCRIPTION
22The \fBiconv_open\fP function allocates a conversion descriptor suitable
23for converting byte sequences from character encoding \fIfromcode\fP to
24character encoding \fItocode\fP.
25.PP
26The values permitted for \fIfromcode\fP and \fItocode\fP and the supported
27combinations are system dependent. For the libiconv library, the following
28encodings are supported, in all combinations.
29.TP
30European languages
31.nf
32.fi
33ASCII, ISO-8859-{1,2,3,4,5,7,9,10,13,14,15,16},
34KOI8-R, KOI8-U, KOI8-RU,
35CP{1250,1251,1252,1253,1254,1257}, CP{850,866},
36Mac{Roman,CentralEurope,Iceland,Croatian,Romania},
37Mac{Cyrillic,Ukraine,Greek,Turkish},
38Macintosh
39.TP
40Semitic languages
41.nf
42.fi
43ISO-8859-{6,8}, CP{1255,1256}, CP862, Mac{Hebrew,Arabic}
44.TP
45Japanese
46.nf
47.fi
48EUC-JP, SHIFT_JIS, CP932, ISO-2022-JP, ISO-2022-JP-2, ISO-2022-JP-1
49.TP
50Chinese
51.nf
52.fi
53EUC-CN, HZ, GBK, GB18030, EUC-TW, BIG5, CP950, BIG5-HKSCS,
54ISO-2022-CN, ISO-2022-CN-EXT
55.TP
56Korean
57.nf
58.fi
59EUC-KR, CP949, ISO-2022-KR, JOHAB
60.TP
61Armenian
62.nf
63.fi
64ARMSCII-8
65.TP
66Georgian
67.nf
68.fi
69Georgian-Academy, Georgian-PS
70.TP
71Tajik
72.nf
73.fi
74KOI8-T
75.TP
76Thai
77.nf
78.fi
79TIS-620, CP874, MacThai
80.TP
81Laotian
82.nf
83.fi
84MuleLao-1, CP1133
85.TP
86Vietnamese
87.nf
88.fi
89VISCII, TCVN, CP1258
90.TP
91Platform specifics
92.nf
93.fi
94HP-ROMAN8, NEXTSTEP
95.TP
96Full Unicode
97.nf
98.fi
99UTF-8
100.nf
101.fi
102UCS-2, UCS-2BE, UCS-2LE
103.nf
104.fi
105UCS-4, UCS-4BE, UCS-4LE
106.nf
107.fi
108UTF-16, UTF-16BE, UTF-16LE
109.nf
110.fi
111UTF-32, UTF-32BE, UTF-32LE
112.nf
113.fi
114UTF-7
115.nf
116.fi
117C99, JAVA
118.TP
119Full Unicode, in terms of \fBuint16_t\fP or \fBuint32_t\fP
120(with machine dependent endianness and alignment)
121.nf
122.fi
123UCS-2-INTERNAL, UCS-4-INTERNAL
124.TP
125Locale dependent, in terms of \fBchar\fP or \fBwchar_t\fP
126(with machine dependent endianness and alignment, and with semantics
127depending on the OS and the current LC_CTYPE locale facet)
128.nf
129.fi
130char, wchar_t
131.PP
132When configured with the option \fB\-\-enable-extra-encodings\fP, it also
133provides support for a few extra encodings:
134.TP
135European languages
136.nf
137CP{437,737,775,852,853,855,857,858,860,861,863,865,869,1125}
138.fi
139.TP
140Semitic languages
141.nf
142.fi
143CP864
144.TP
145Japanese
146.nf
147.fi
148EUC-JISX0213, Shift_JISX0213, ISO-2022-JP-3
149.TP
150Turkmen
151.nf
152.fi
153TDS565
154.TP
155Platform specifics
156.nf
157.fi
158RISCOS-LATIN1
159.PP
160The empty encoding name "" is equivalent to "char": it denotes the
161locale dependent character encoding.
162.PP
163When the string "//TRANSLIT" is appended to \fItocode\fP, transliteration
164is activated. This means that when a character cannot be represented in the
165target character set, it can be approximated through one or several
166similarly looking characters.
167.PP
168When the string "//IGNORE" is appended to \fItocode\fP, characters that
169cannot be represented in the target character set will be silently discarded.
170.PP
171The resulting conversion descriptor can be used with \fBiconv\fP any number
172of times. It remains valid until deallocated using \fBiconv_close\fP.
173.PP
174A conversion descriptor contains a conversion state. After creation using
175\fBiconv_open\fP, the state is in the initial state. Using \fBiconv\fP
176modifies the descriptor's conversion state. (This implies that a conversion
177descriptor can not be used in multiple threads simultaneously.) To bring the
178state back to the initial state, use \fBiconv\fP with NULL as \fIinbuf\fP
179argument.
180.SH "RETURN VALUE"
181The \fBiconv_open\fP function returns a freshly allocated conversion
182descriptor. In case of error, it sets \fBerrno\fP and returns (iconv_t)(-1).
183.SH ERRORS
184The following error can occur, among others:
185.TP
186.B EINVAL
187The conversion from \fIfromcode\fP to \fItocode\fP is not supported by the
188implementation.
189.SH "CONFORMING TO"
190UNIX98
191.SH "SEE ALSO"
192.BR iconv "(3), " iconv_close (3)
Note: See TracBrowser for help on using the repository browser.