The iconv library is intended to convert characters from one encoding to another. It implements iconv(), iconv_open() and iconv_close() calls, which are defined by the Single Unix Specification.
In addition to these user-level interfaces, the iconv library also has several useful interfaces which are needed to support coding capabilities of the Newlib Locale infrastructure. Since Locale support also needs to convert various character sets to and from the wide characters set, the iconv library shares it’s capabilities with the Newlib Locale subsystem. Moreover, the iconv library supports several features which are only needed for the Locale infrastructure (for example, the MB_CUR_MAX value).
The Newlib iconv library was created using concepts from another iconv library implemented by Konstantin Chuguev (ver 2.0). The Newlib iconv library was rewritten from scratch and contains a lot of improvements with respect to the original iconv library.
Terms like encoding or character set aren’t well defined and are often used with various meanings. The following are the definitions of terms which are used in this documentation as well as in the iconv library implementation:
Users usually deal with encodings, for example, KOI8-R, Unicode, UTF-8, ASCII, etc. Encodings are formed by the following chain of steps:
Thus, an encoding may be considered as one or more CCS + CES.
Sometimes, there is no CES and in such cases encoding is equivalent to CCS, e.g. KOI8-R or ASCII.
An example of a more complicated encoding is UTF-8 which is the UCS (or Unicode) CCS plus the UTF-8 CES.
The following is a brief list of iconv library features: