DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

iconv_open(S)


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(C), iconv(S), iconv_close(S), iconvh(M)

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.


© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 - 01 June 2005