]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/iconv_open.3
Automated addition of parentheses by add_parens_for_own_funcs.sh
[thirdparty/man-pages.git] / man3 / iconv_open.3
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
22 The \fBiconv_open\fP() function allocates a conversion descriptor suitable
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
27 combinations are system dependent. For the GNU C library, the permitted
28 values are listed by the \fBiconv \-\-list\fP command, and all combinations
29 of the listed values are supported.
30 .PP
31 The resulting conversion descriptor can be used with \fBiconv\fP any number
32 of times. It remains valid until deallocated using \fBiconv_close\fP.
33 .PP
34 A conversion descriptor contains a conversion state. After creation using
35 \fBiconv_open\fP(), the state is in the initial state. Using \fBiconv\fP
36 modifies the descriptor's conversion state. (This implies that a conversion
37 descriptor can not be used in multiple threads simultaneously.) To bring the
38 state back to the initial state, use \fBiconv\fP with NULL as \fIinbuf\fP
39 argument.
40 .SH "RETURN VALUE"
41 The \fBiconv_open\fP() function returns a freshly allocated conversion
42 descriptor. In case of error, it sets \fBerrno\fP and returns (iconv_t)(\-1).
43 .SH ERRORS
44 The following error can occur, among others:
45 .TP
46 .B EINVAL
47 The conversion from \fIfromcode\fP to \fItocode\fP is not supported by the
48 implementation.
49 .SH "CONFORMING TO"
50 UNIX98
51 .SH "SEE ALSO"
52 .BR iconv (1),
53 .BR iconv (3),
54 .BR iconv_close (3)