I have a database of html encoded strings which was originally windows-1256 (arabic) encoded i want to decoded it from html and unicode it and save it on a mysql database. The problem is the string is html decoded to Latin characters. If I echo the values and use <META http-equiv=Content-Type content="text/html;charset=windows-1256"> I can see the string properly (in arabic), but when inserting into database it is back to Latin
Example:
Code: Select all
<meta http-equiv="Content-Language" content="ar-sa">
<META http-equiv=Content-Type content="text/html;charset=windows-1256">
<?php
$s= html_entity_decode("åÇäí ÑÔÇÏ ÓãÚÇä ÝÑÍ");
echo $s;
?>
I tried mb_string functions like mb_convert_encoding but it doesnt take this "windows-1256" or "cp1256"
Warning: mb_convert_encoding() [function.mb-convert-encoding]: Unknown encoding "windows-1256" in ...
also tried some iconv stuff.
Any help is appreciated