1ICONV_OPEN(P) POSIX Programmer's Manual ICONV_OPEN(P)
2
3
4
6 iconv_open - codeset conversion allocation function
7
9 #include <iconv.h>
10
11 iconv_t iconv_open(const char *tocode, const char *fromcode);
12
13
15 The iconv_open() function shall return a conversion descriptor that
16 describes a conversion from the codeset specified by the string pointed
17 to by the fromcode argument to the codeset specified by the string
18 pointed to by the tocode argument. For state-dependent encodings, the
19 conversion descriptor shall be in a codeset-dependent initial shift
20 state, ready for immediate use with iconv().
21
22 Settings of fromcode and tocode and their permitted combinations are
23 implementation-defined.
24
25 A conversion descriptor shall remain valid until it is closed by
26 iconv_close() or an implicit close.
27
28 If a file descriptor is used to implement conversion descriptors, the
29 FD_CLOEXEC flag shall be set; see <fcntl.h>.
30
32 Upon successful completion, iconv_open() shall return a conversion
33 descriptor for use on subsequent calls to iconv(). Otherwise,
34 iconv_open() shall return (iconv_t)-1 and set errno to indicate the
35 error.
36
38 The iconv_open() function may fail if:
39
40 EMFILE {OPEN_MAX} file descriptors are currently open in the calling
41 process.
42
43 ENFILE Too many files are currently open in the system.
44
45 ENOMEM Insufficient storage space is available.
46
47 EINVAL The conversion specified by fromcode and tocode is not supported
48 by the implementation.
49
50
51 The following sections are informative.
52
54 None.
55
57 Some implementations of iconv_open() use malloc() to allocate space for
58 internal buffer areas. The iconv_open() function may fail if there is
59 insufficient storage space to accommodate these buffers.
60
61 Conforming applications must assume that conversion descriptors are not
62 valid after a call to one of the exec functions.
63
64 Application developers should consult the system documentation to
65 determine the supported codesets and their naming schemes.
66
68 None.
69
71 None.
72
74 iconv() , iconv_close() , the Base Definitions volume of
75 IEEE Std 1003.1-2001, <fcntl.h>, <iconv.h>
76
78 Portions of this text are reprinted and reproduced in electronic form
79 from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
80 -- Portable Operating System Interface (POSIX), The Open Group Base
81 Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
82 Electrical and Electronics Engineers, Inc and The Open Group. In the
83 event of any discrepancy between this version and the original IEEE and
84 The Open Group Standard, the original IEEE and The Open Group Standard
85 is the referee document. The original Standard can be obtained online
86 at http://www.opengroup.org/unix/online.html .
87
88
89
90IEEE/The Open Group 2003 ICONV_OPEN(P)