好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

iconv() [function.iconv]: Detected an illegal char

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

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

解决方法:

iconv( 'UTF-8' ,  'GB2312//IGNORE' ,  '??' )  iconv( 'UTF-8' ,  'GBK' ,  '??' ) 

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

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

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

header( "content-Type: text/html; charset=big5" );     echo  mb_convert_encoding( "你是我的朋友" ,  "big5" ,  "GB2312" );     ?> 

查看更多关于iconv() [function.iconv]: Detected an illegal char的详细内容...

  阅读:37次