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.  (This implies that a con‐
41       version descriptor can not be used in multiple threads simultaneously.)
42       To bring the state back to the initial state, use iconv(3) with NULL as
43       inbuf argument.
44

RETURN VALUE

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

ERRORS

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

VERSIONS

56       This function is available in glibc since version 2.1.
57

CONFORMING TO

59       UNIX98, POSIX.1-2001.
60

SEE ALSO

62       iconv(1), iconv(3), iconv_close(3)
63

COLOPHON

65       This page is part of release 3.53 of the Linux  man-pages  project.   A
66       description  of  the project, and information about reporting bugs, can
67       be found at http://www.kernel.org/doc/man-pages/.
68
69
70
71GNU                               2008-08-11                     ICONV_OPEN(3)
Impressum