使用iconv提示未知错误

使用iconv 转化编码的时候提示错误:<b>Notice</b>: iconv() [<a href='http://www.jinyuanbao.cn'>function.iconv</a>]
php手册原文说明:
If you append the string //TRANSLIT to out_charset transliteration is activated. This means that when a character can't be represented in the target charset, it can be approximated through one or several similarly looking characters. If you append the string //IGNORE, characters that cannot be represented in the target charset are silently discarded. Otherwise, str is cut from the first illegal character.

如果追加的字符串// TRANSLIT 表示:当一个字符不能在目标字符集,它可以通过一个或几个同样寻找字符近似

追加的字符串// IGNORE:则忽略不能再目标集表示的字符

从而得出解决方法:

iconv("UTF-8","GBK//IGNORE",$str) 或者是iconv("UTF-8","GBK//TRANSLIT",$str)

posted @ 2014-09-24 16:29  jyb2014  阅读(174)  评论(0)    收藏  举报