普及一下: 字符必须编码后才能被计算机处理。计算机使用的缺省编码方式就是计算机的内码。早期的计算机使用7位的ASCII编码,为了处理汉字,程序员设计了用于简体中文的GB2312和用于繁体中文的big5。 Unicode也是一种字符编码方法,不过它是由国际组织设计,可以容纳全世界所有语言文字的编码方案。Unicode的学名是"Universal Multiple-Octet Coded Character Set",简称为UCS。UCS可以看作是"Unicode Character Set"的缩写。
/* Allocate descriptor for code conversion from codeset FROMCODE to codeset TOCODE.
This function is a possible cancellation points and therefore not marked with __THROW. */ extern iconv_t iconv_open (__const char *__tocode, __const char *__fromcode);
/* Convert at most *INBYTESLEFT bytes from *INBUF according to the code conversion algorithm specified by CD and place up to *OUTBYTESLEFT bytes in buffer at *OUTBUF. */ extern size_t iconv (iconv_t __cd, char **__restrict __inbuf, size_t *__restrict __inbytesleft, char **__restrict __outbuf, size_t *__restrict __outbytesleft);
/* Free resources allocated for descriptor CD for code conversion.
This function is a possible cancellation points and therefore not marked with __THROW. */ extern int iconv_close (iconv_t __cd);