This article introduces several solutions to iconv () [function. iconv]: Detected an illegal character in errors. For more information, see.
When I use the iconv function to convert gb2312 to UTF-8, why do some Chinese characters have problems, such "?? Quot; the prompt is as follows:
Notice: iconv () [function. iconv]: Detected an illegal character in input string
Solution:
The Code is as follows: |
Copy code |
Iconv ('utf-8', 'gb2312 // IGNORE ','?? ') Iconv ('utf-8', 'gbk ','?? ') |
Or the code is not correct, or the inhibitor @ is added @
We can also use other operations
Make a GBK To UTF-8
Mb_convert_encoding ()
Php code
The Code is as follows: |
Copy code |
<? Php Header ("content-Type: text/html; charset = Utf-8 "); Echo mb_convert_encoding ("??? S my friends "," UTF-8 "," GBK "); ?> |
Another GB2312 To Big5
The Code is as follows: |
Copy code |
<? Php Header ("content-Type: text/html; charset = big5 "); Echo mb_convert_encoding ("you are my friend", "big5", "GB2312 "); ?> |