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