I use iconv php function but some characters doesn’t convert correctly:
...
$s = iconv('UTF-16', 'UTF-8', $s);
...
$s = iconv('UTF-16//IGNORE', 'UTF-8', $s);
...
$s = iconv('UTF-16LE', 'UTF-8', $s);
...
$s = iconv('UTF-16LE//IGNORE', 'UTF-8', $s);
...
I also try mb_convert_encoding function but can’t solve my problem.
A sample text file: 9px.ir/utf8-16LE.rar
iconvsupports theUTF-16LEencoding.You can use it to transpose the encoding from
UTF-16LEtoUTF-8:See
iconvDocs.I’m just wondering if all code-points available in
UTF-16LEare available inUTF-8. But I assume that this should fit in your case.Edit: I was not able to reproduce the problem on a box of my own, but on another box I ran into this notice:
Looks like that not all
iconvversions can actually convertUTF-16LEtoUTF-8.It might be a workaround to use
mb_convert_encodingDocs instead, at least it was in this case (Demo):