1ICONV_OPEN(3)              Linux Programmer's Manual             ICONV_OPEN(3)
2
3
4

NAME

6       iconv_open - allocate descriptor for character set conversion
7

SYNOPSIS

9       #include <iconv.h>
10
11       iconv_t iconv_open(const char *tocode, const char *fromcode);
12

DESCRIPTION

14       The  iconv_open()  function  allocates a conversion descriptor suitable
15       for converting byte sequences from character encoding fromcode to char‐
16       acter encoding tocode.
17
18       The values permitted for fromcode and tocode and the supported combina‐
19       tions are system-dependent.  For the GNU C library, the permitted  val‐
20       ues are listed by the iconv --list command, and all combinations of the
21       listed values are supported.  Furthermore the GNU C library and the GNU
22       libiconv library support the following two suffixes:
23
24       //TRANSLIT
25              When the string "//TRANSLIT" is appended to tocode, translitera‐
26              tion is activated.  This means that when a character  cannot  be
27              represented  in the target character set, it can be approximated
28              through one or several similarly looking characters.
29
30       //IGNORE
31              When the string "//IGNORE" is  appended  to  tocode,  characters
32              that  cannot  be represented in the target character set will be
33              silently discarded.
34
35       The resulting conversion descriptor can be used with iconv(3) any  num‐
36       ber of times.  It remains valid until deallocated using iconv_close(3).
37
38       A  conversion  descriptor  contains a conversion state.  After creation
39       using iconv_open(), the state is in the initial state.  Using  iconv(3)
40       modifies the descriptor's conversion state.  To bring the state back to
41       the initial state, use iconv(3) with NULL as inbuf argument.
42

RETURN VALUE

44       The  iconv_open()  function  returns  a  freshly  allocated  conversion
45       descriptor.  In case of error, it sets errno and returns (iconv_t) -1.
46

ERRORS

48       The following error can occur, among others:
49
50       EINVAL The  conversion  from fromcode to tocode is not supported by the
51              implementation.
52

VERSIONS

54       This function is available in glibc since version 2.1.
55

ATTRIBUTES

57       For  an  explanation  of  the  terms  used   in   this   section,   see
58       attributes(7).
59
60       ┌─────────────┬───────────────┬────────────────┐
61Interface    Attribute     Value          
62       ├─────────────┼───────────────┼────────────────┤
63iconv_open() │ Thread safety │ MT-Safe locale │
64       └─────────────┴───────────────┴────────────────┘
65

CONFORMING TO

67       POSIX.1-2001, POSIX.1-2008, SUSv2.
68

SEE ALSO

70       iconv(1), iconv(3), iconv_close(3)
71

COLOPHON

73       This  page  is  part of release 5.04 of the Linux man-pages project.  A
74       description of the project, information about reporting bugs,  and  the
75       latest     version     of     this    page,    can    be    found    at
76       https://www.kernel.org/doc/man-pages/.
77
78
79
80GNU                               2017-09-15                     ICONV_OPEN(3)
Impressum