I am getting Windows-1256 encoded text from the web and nee to convert it to utf-8.
I tried using mb_convert_encoding and iconv but they don't seem to work.
none of them seem to be capable of handling windows-1256.
How to do it?
Edit: More details about the errors. When trying
mb_convert_encoding($text,"utf-8", "windows-1256");
I get
Message: mb_convert_encoding() [function.mb-convert-encoding]: Illegal character encoding specified
And when i try
iconv("windows-1256", "utf-8", $text);
I get no errors but it returns an empty string
Trying
echo iconv('WINDOWS-1256', 'UTF-8', 'testÍÊ');
...on http://writecodeonline.com/php/ seems to work correctly (produces testأچأٹ)
Try this, should work:
iconv("windows-1256", "utf-8//TRANSLIT//IGNORE", $text)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With