php专区

 首页 > php专区 > PHP应用 > php函数大全 > iconv() [function.iconv]: Detected an illegal character in -

iconv() [function.iconv]: Detected an illegal character in -

分享到:
【字体:
导读:
          用iconv函数将gb2312转换为utf-8时,怎么有些汉字会出现问题,像 "??;字就会提示如下:Notice: iconv() [function iconv]: Detected an il...

iconv() [function.iconv]: Detected an illegal character in

用iconv函数将gb2312转换为utf-8时,怎么有些汉字会出现问题,像"??;字就会提示如下:Notice: iconv() [function.iconv]: Detected an illegal character in input string

解决方法:

  1. iconv('UTF-8''GB2312//IGNORE''??'
  2. iconv('UTF-8''GBK''??'

或者是编码不对,或者增加抑制符@,我们还可以使用其它方法操作,做一个GBK To UTF-8

mb_convert_encoding()使用详解,php代码如下:

  1. header("content-Type: text/html; charset=Utf-8"); 
  2. echo mb_convert_encoding("???S我的友仔""UTF-8""GBK"); 
  3. ?> 

再来个GB2312 To Big5,代码如下:

  1. header("content-Type: text/html; charset=big5");    
  2. echo mb_convert_encoding("你是我的朋友""big5""GB2312");    
  3. ?> 
分享到:
php提示:Call to undefined function cur...
php提示:Call to undefined function curl_init 我要利用curl函数进行数据采集时发现提示Call to undefined function curl_init错误了,后来从官网了解到因为curl默认不是php开启的函数,我们需要手工打开哦,下面我来给大家介绍开启curl函数,例: $ch = curl_init(); //初始化curl ...
PHP JSON_DECODE/JSON_ENCODE中文内容为N...
PHP JSON_DECODE/JSON_ENCODE中文内容为NULL或乱码 可能用很多朋友使用json数据时利用php自带的函数JSON_DECODE/JSON_ENCODE处理中文内容时会碰到出现NULL或乱码问题,下面我来给大家介绍为什么会出现这样的问题,例:   输出结果 object(stdClass)#1 (5) {     ["a"] => int(1)...
  •         php迷,一个php技术的分享社区,专属您自己的技术摘抄本、收藏夹。
  • 在这里……