]>
Commit | Line | Data |
---|---|---|
fea681da MK |
1 | .\" Copyright (c) Bruno Haible <haible@clisp.cons.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 1999-11-27 "GNU" "Linux Programmer's Manual" | |
13 | .SH NAME | |
14 | iconv_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 | |
e511ffb6 | 22 | The \fBiconv_open\fP() function allocates a conversion descriptor suitable |
fea681da MK |
23 | for converting byte sequences from character encoding \fIfromcode\fP to |
24 | character encoding \fItocode\fP. | |
25 | .PP | |
26 | The values permitted for \fIfromcode\fP and \fItocode\fP and the supported | |
c13182ef MK |
27 | combinations are system dependent. |
28 | For the GNU C library, the permitted | |
c65433e6 | 29 | values are listed by the \fBiconv \-\-list\fP command, and all combinations |
fea681da MK |
30 | of the listed values are supported. |
31 | .PP | |
3382bd94 | 32 | The resulting conversion descriptor can be used with \fBiconv\fP() any number |
c13182ef MK |
33 | of times. |
34 | It remains valid until deallocated using \fBiconv_close\fP(). | |
fea681da | 35 | .PP |
c13182ef MK |
36 | A conversion descriptor contains a conversion state. |
37 | After creation using | |
38 | \fBiconv_open\fP(), the state is in the initial state. | |
39 | Using \fBiconv\fP() | |
40 | modifies the descriptor's conversion state. | |
41 | (This implies that a conversion | |
42 | descriptor can not be used in multiple threads simultaneously.) | |
43 | To bring the state back to the initial state, use \fBiconv\fP() | |
44 | with NULL as \fIinbuf\fP argument. | |
fea681da | 45 | .SH "RETURN VALUE" |
e511ffb6 | 46 | The \fBiconv_open\fP() function returns a freshly allocated conversion |
c13182ef MK |
47 | descriptor. |
48 | In case of error, it sets \fIerrno\fP and returns (iconv_t)(\-1). | |
fea681da MK |
49 | .SH ERRORS |
50 | The following error can occur, among others: | |
51 | .TP | |
52 | .B EINVAL | |
53 | The conversion from \fIfromcode\fP to \fItocode\fP is not supported by the | |
54 | implementation. | |
55 | .SH "CONFORMING TO" | |
68e1685c | 56 | UNIX98, POSIX.1-2001. |
fea681da MK |
57 | .SH "SEE ALSO" |
58 | .BR iconv (1), | |
59 | .BR iconv (3), | |
60 | .BR iconv_close (3) |