This article to introduce Iconv () [Function.iconv]: detected an illegal character in error several solutions, there is a need to understand the friend can refer to.
When using the Iconv function to convert gb2312 to Utf-8, how do some Chinese characters appear to have problems, like "??". quot, the Word will prompt as follows:
Notice:iconv () [Function.iconv]: detected an illegal character in input string
Workaround:
The code is as follows |
Copy Code |
Iconv (' UTF-8 ', ' gb2312//ignore ', '?? ') Iconv (' UTF-8 ', ' GBK ', '?? ') |
Either the encoding is incorrect or the suppression is added
We can also use other methods to manipulate
Make a GBK to UTF-8
Mb_convert_encoding () using the detailed
PHP code
The code is as follows |
Copy Code |
Header ("content-type:text/html; Charset=utf-8 "); Echo mb_convert_encoding ("??? s my friend "," UTF-8 "," GBK "); ?> |
One more GB2312 to Big5.
The code is as follows |
Copy Code |
Header ("content-type:text/html; Charset=big5 "); Echo mb_convert_encoding ("You Are my Friend", "Big5", "GB2312"); ?> |
http://www.bkjia.com/PHPjc/632119.html www.bkjia.com true http://www.bkjia.com/PHPjc/632119.html techarticle This article to introduce Iconv () [Function.iconv]: detected an illegal character in error several solutions, there is a need to understand the friend can refer to. Convert gb2312 to ... using the Iconv function .