Using Iconv () to convert a character that is not supported by an output character encoding, such as Iconv (' UTF-8 ', ' GB2312 ', ' embarrassing '), you may encounter such error prompts:
Notice:iconv () [Function.iconv]: detected a illegal character in input string ...
Because GB2312 is simplified Chinese and does not support more complex Chinese characters such as "embarrassing" and some special characters, this will certainly be an error, and there are two ways to solve this problem :
1. enlarge the range of the output character encoding, such as Iconv (' UTF-8 ', ' GBK ', ' the ', '), it can be output correctly, because the GBK supports a wider range of characters;
2. Add "//ignore" to the output character-encoded string, such as Iconv (' UTF-8 ', ' gb2312//ignore ', ' ' embarrassing '), which in fact ignores characters that cannot be converted, avoids errors but does not output correctly ( That is, blank, output).