Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

iconv_open - allocate code conversion descriptor

&pagelevel(4)&pagelevel

Syntax

#include <iconv.h>

iconv_t iconv_open(const char *tocode, const char *fromcode); 

Description

iconv_open() returns a conversion descriptor that describes a conversion from the
codeset specified by the string pointed to by the fromcode argument to the codeset specified
by the string pointed to by the tocode argument. For state-dependent encodings, the
conversion descriptor will be in a codeset-dependent initial shift state, ready for immediate
use with iconv().

A conversion descriptor remains valid in a process until that process closes it.

iconv_open() uses the malloc() function to allocate space for internal buffer areas. The
iconv_open() function will fail if insufficient space is available for these buffers.

Return val.

Conversion descriptor

for use on subsequent calls to iconv().
Otherwise, iconv_open() returns (iconv_t)-1 and sets
errno to indicate the error.

Errors

iconv_open() will fail if:

EMFILE

ENFILE

ENOMEM

EINVAL

OPEN_MAX file descriptors are currently open in the calling process.

Too many files are currently open in the system.

Insufficient storage space is available.

The conversion specified by fromcode and tocode is not supported by
the current version.

See also

iconv(), iconv_close(), iconv.h.