Data is delivered on the business occasion and requires transcoding, from UTF-8 to GBK. PHP function compared to the mentally retarded, resulting in a large number of data conversion failure, there is no better transcoding method, you can automatically ignore the content cannot be converted to a successful encoding, do not lose data?
Reply content:
Data is delivered on the business occasion and requires transcoding, from UTF-8 to GBK. PHP function compared to the mentally retarded, resulting in a large number of data conversion failure, there is no better transcoding method, you can automatically ignore the content cannot be converted to a successful encoding, do not lose data?
http://php.net/manual/en/function.iconv.php
Use //IGNORE
to ignore words that cannot be converted
php
iconv("UTF-8", "GBK//IGNORE", $text);
Upstairs says the designation ignore is a bit, but this article still has the problem of the bug, simply wrote down:
Http://www.yundaiwei.com/post/375.html
There is almost no introduction to this bug in the Chinese website, the English site is mentioned, but it is not clear, and now do not know which or which version of the bug, in short, the installation of the environment when the latest iconv will not have a problem.