Home >Backend Development >PHP Tutorial >iconv transcoding failed for UTF8 encoded page in php_PHP tutorial
This article introduces the content loss and solutions when using iconv to encounter characters that cannot be transcoded when storing GBK data in a UTF8 encoded page. Students who have encountered such problems can refer to it.
About iconv interrupting and losing content when encountering characters that cannot be transcoded
The code is as follows
|
Copy code
|
||||||
$c = ‘Test•Character transfer•Happy May Day! ’; echo iconv(‘utf-8′, ‘gbk’,$c); Only output: test
The last one will be lost. Solution: |
The code is as follows | Copy code |
$c = ‘Test•Character transfer•Happy May Day! ’;