|
NAMEiconv_open - allocate descriptor for character set conversionSYNOPSIS#include <iconv.h> iconv_t iconv_open (const char* tocode, const char* fromcode); DESCRIPTIONThe iconv_open function allocates a conversion descriptor suitable for converting byte sequences from character encoding fromcode to character encoding tocode.The values permitted for fromcode and tocode and the supported combinations are system dependent. For the libiconv library, the following encodings are supported, in all combinations.
When configured with the option --enable-extra-encodings, it also provides support for a few extra encodings:
The empty encoding name "" is equivalent to "char": it denotes the locale dependent character encoding. When the string "//TRANSLIT" is appended to tocode, transliteration is activated. This means that when a character cannot be represented in the target character set, it can be approximated through one or several characters that look similar to the original character. When the string "//IGNORE" is appended to tocode, characters that cannot be represented in the target character set will be silently discarded. The resulting conversion descriptor can be used with iconv any number of times. It remains valid until deallocated using iconv_close. A conversion descriptor contains a conversion state. After creation using iconv_open, the state is in the initial state. Using iconv modifies the descriptor's conversion state. (This implies that a conversion descriptor can not be used in multiple threads simultaneously.) To bring the state back to the initial state, use iconv with NULL as inbuf argument. RETURN VALUEThe iconv_open function returns a freshly allocated conversion descriptor. In case of error, it sets errno and returns (iconv_t)(-1).ERRORSThe following error can occur, among others:
CONFORMING TOPOSIX:2001SEE ALSOiconv(3) iconvctl(3) iconv_close(3)
Visit the GSP FreeBSD Man Page Interface. |