iconv() [function.iconv]: Detected an illegal character in_PHP教程
程序员文章站
2022-05-09 18:37:40
...
本文章来给大家介绍iconv() [function.iconv]: Detected an illegal character in 错误的几种解决办法,有需要了解的朋友可参考。
用iconv函数将gb2312转换为utf-8时,怎么有些汉字会出现问题,像"??quot;字就会提示如下:
Notice: iconv() [function.iconv]: Detected an illegal character in input string
解决方法:
代码如下 | 复制代码 |
iconv('UTF-8', 'GB2312//IGNORE', '??') |
或者是编码不对,或者增加抑制符@
我们还可以使用其它方法操作
做一个GBK To UTF-8
mb_convert_encoding()使用详解
Php代码
代码如下 | 复制代码 |
header("content-Type: text/html; charset=Utf-8"); |
再来个GB2312 To Big5
代码如下 | 复制代码 |
header("content-Type: text/html; charset=big5"); echo mb_convert_encoding("你是我的朋友", "big5", "GB2312"); ?> |
推荐阅读
-
php iconv() : Detected an illegal character in input string
-
iconv() [function.iconv]: Detected an illegal character in
-
iconv() [function.iconv]: Detected an illegal character in
-
iconv() [function.iconv]: Detected an illegal character in_PHP教程
-
php iconv() 编码转换出错 Detected an illegal character_PHP教程
-
PHP错误:iconv Detected an illegal character
-
iconv() [function.iconv]: Detected an illegal character in_PHP教程
-
php iconv() 编码转换出错 Detected an illegal character
-
php iconv() : Detected an illegal character in input string_PHP教程
-
PHP错误:iconv Detected an illegal character