Swap gb2312 with UTF-8 in PHP.
Gb2312 UTF-8
Iconv("Gb2312", "UTF-8", $ text)
UTF-8-gb2312
Iconv("UTF-8", "gb2312", $ text)
ConvThe function converts the captured UTF-8 encoded page to gb2312.IconvThe function will reduce the amount of data captured by Code Conversion for no reason. Check the information on the Internet to know that this isIconvA Function Bug.IconvAn error occurs when converting the character "-" To gb2312.
The solution is simple, that is, add "// ignore" after the code to be convertedIconvThe second parameter of the function is as follows:
Reference content is as follows:
Iconv("UTF-8", "gb2312 // ignore", $ data)
Ignore indicates that the conversion error is ignored. Without the ignore parameter, all strings after this character cannot be saved.
IconvNoPHPIs also the default function installed by default. Installation is required.
Author:
Sjolzy | Google +
Address: Http://sjolzy.cn/gb2312-and-utf8-conversion.html