附:iconv 用法
string iconv ( string $in_charset , string $out_charset , string $str )
iconv — Convert string to requested character encoding
参数:
1,in_charset 输入字符串的编码
2,out_charset 输出字符串的编码
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 and an E_NOTICE is generated.
3,str 被转码的字符串
返回值:
返回转码后的字符串或false(返回失败时)。
可能会用到两个可选的辅助参数:IGNORE和TRANSLIT
例如:iconv("UTF-8","GB2312//IGNORE",$data)