ICONV_OPEN(3)              POSIX Programmer's Manual             ICONV_OPEN(3)



PPRROOLLOOGG
       This manual page is part of the POSIX Programmer's Manual.  The OS
       implementation of this interface may differ (consult the corresponding
       OS manual page for details of OS behavior), or the interface may not be
       implemented on OS.


NNAAMMEE
       iconv_open -- codeset conversion allocation function

SSYYNNOOPPSSIISS
       #include <iconv.h>

       iconv_t iconv_open(const char *_t_o_c_o_d_e, const char *_f_r_o_m_c_o_d_e);

DDEESSCCRRIIPPTTIIOONN
       The _i_c_o_n_v___o_p_e_n() function shall return a conversion descriptor that
       describes a conversion from the codeset specified by the string pointed
       to by the _f_r_o_m_c_o_d_e argument to the codeset specified by the string
       pointed to by the _t_o_c_o_d_e argument. For state-dependent encodings, the
       conversion descriptor shall be in a codeset-dependent initial shift
       state, ready for immediate use with _i_c_o_n_v().

       Settings of _f_r_o_m_c_o_d_e and _t_o_c_o_d_e and their permitted combinations are
       implementation-defined.

       A conversion descriptor shall remain valid until it is closed by
       _i_c_o_n_v___c_l_o_s_e() or an implicit close.

       If a file descriptor is used to implement conversion descriptors, the
       FD_CLOEXEC flag shall be set; see _<_f_c_n_t_l_._h_>.

RREETTUURRNN VVAALLUUEE
       Upon successful completion, _i_c_o_n_v___o_p_e_n() shall return a conversion
       descriptor for use on subsequent calls to _i_c_o_n_v().  Otherwise,
       _i_c_o_n_v___o_p_e_n() shall return (iiccoonnvv__tt)-1 and set _e_r_r_n_o to indicate the
       error.

EERRRROORRSS
       The _i_c_o_n_v___o_p_e_n() function may fail if:

       EEMMFFIILLEE All file descriptors available to the process are currently
              open.

       EENNFFIILLEE Too many files are currently open in the system.

       EENNOOMMEEMM Insufficient storage space is available.

       EEIINNVVAALL The conversion specified by _f_r_o_m_c_o_d_e and _t_o_c_o_d_e is not supported
              by the implementation.

       _T_h_e _f_o_l_l_o_w_i_n_g _s_e_c_t_i_o_n_s _a_r_e _i_n_f_o_r_m_a_t_i_v_e_.

EEXXAAMMPPLLEESS
       None.

AAPPPPLLIICCAATTIIOONN UUSSAAGGEE
       Some implementations of _i_c_o_n_v___o_p_e_n() use _m_a_l_l_o_c() to allocate space for
       internal buffer areas. The _i_c_o_n_v___o_p_e_n() function may fail if there is
       insufficient storage space to accommodate these buffers.

       Conforming applications must assume that conversion descriptors are not
       valid after a call to one of the _e_x_e_c functions.

       Application developers should consult the system documentation to
       determine the supported codesets and their naming schemes.

RRAATTIIOONNAALLEE
       None.

FFUUTTUURREE DDIIRREECCTTIIOONNSS
       None.

SSEEEE AALLSSOO
       _i_c_o_n_v(), _i_c_o_n_v___c_l_o_s_e()

       The Base Definitions volume of POSIX.1-2008, <<ffccnnttll..hh>>, <<iiccoonnvv..hh>>

CCOOPPYYRRIIGGHHTT
       Portions of this text are reprinted and reproduced in electronic form
       from IEEE Std 1003.1, 2013 Edition, Standard for Information Technology
       -- Portable Operating System Interface (POSIX), The Open Group Base
       Specifications Issue 7, Copyright (C) 2013 by the Institute of
       Electrical and Electronics Engineers, Inc and The Open Group.  (This is
       POSIX.1-2008 with the 2013 Technical Corrigendum 1 applied.) In the
       event of any discrepancy between this version and the original IEEE and
       The Open Group Standard, the original IEEE and The Open Group Standard
       is the referee document. The original Standard can be obtained online
       at http://www.unix.org/online.html .

       Any typographical or formatting errors that appear in this page are
       most likely to have been introduced during the conversion of the source
       files to man page format. To report such errors, see
       https://www.kernel.org/doc/man-pages/reporting_bugs.html .



IEEE/The Open Group                  2013                        ICONV_OPEN(3)
