iconv_open(3C)


iconv_open -- code conversion allocation function.

Synopsis

   #include <iconv.h>
   

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

Description

iconv_open returns a conversion descriptor for the codeset conversion from codeset fromcode to codeset tocode. This descriptor is used on subsequent calls to iconv.

The allowable values for fromcode and tocode are dependent on the implementation. This is also true for the different combinations allowed.

A conversion descriptor is valid until the creating process terminates, or until it is passed to iconv_close.

Return values

If iconv_open completes successfully, a conversion descriptor is returned. Should the function fail,iconv_open returns (iconv_t)-1 and errno is set to indicate an error.

Errors


EMFILE
There may be no more file descriptors free for the process.

ENFILE
There may be too many open files on the system.

ENOMEM
Not enough memory.

EINVAL
The implementation does not support the specified conversion.

References

iconv(1), iconv(3C), iconv_close(3C), iconvh(5)

Notices

In some implementations, this function uses dynamic memory allocation (malloc) to provide space for internal buffer areas. If there is not enough space to cater for these buffers, it is likely that the iconv_open function will fail.

Applications that are portable must assume that conversion descriptors are invalidated after one of the ``exec'' functions is called.


© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004