Resolution of truncation character problem when iconv function transcoding in PHP, Iconv truncation
Iconv is a conversion code, but in Chinese transcoding occurs when the display is not complete.
Copy the Code code as follows:
Iconv ("UTF-8", "Gb2312//ignore", $data); Add//ignore, ignore errors
or with mb_convert_encoding ()
Copy the Code code as follows:
<?php
/* Convert internal code to SJIS */
$str = mb_convert_encoding ($str, "SJIS");
/* Convert EUC-JP to UTF-7 */
$str = mb_convert_encoding ($str, "UTF-7", "EUC-JP");
/* automatically detects the encoding from JIS, Eucjp-win, Sjis-win, and converts str to Ucs-2le */
$str = mb_convert_encoding ($str, "Ucs-2le", "JIS, Eucjp-win, Sjis-win");
/* "Auto" expands to "ascii,jis,utf-8,euc-jp,sjis" */
$str = mb_convert_encoding ($str, "EUC-JP", "Auto");
?>
Insurance is for mb_conver_encoding.
http://www.bkjia.com/PHPjc/945712.html www.bkjia.com true http://www.bkjia.com/PHPjc/945712.html techarticle php iconv function transcoding in the resolution of truncation character problem, Iconv truncation Iconv is the conversion code, but in the Chinese transcoding when the display is not complete problem. Copy code code as follows ...