PDA

View Full Version : function to convert utf8 to windows 1256



crazy.works
12-15-2008, 06:56 PM
hello,
please help me with function to convert utf8 txt to windows 1256

Fou-Lu
12-16-2008, 01:38 AM
Try the iconv (http://ca3.php.net/manual/en/function.iconv.php) function. Not sure what its support is though, so you may not be able to use Windows1256.

oesxyl
12-16-2008, 05:26 PM
hello,
please help me with function to convert utf8 txt to windows 1256
as far as I know iconv work with win 1256 so Fou-Lu solution is ok. In case you have problem you can also use mb_check_encoding and mb_convert_encoding:

http://www.php.net/manual/en/function.mb-check-encoding.php
http://www.php.net/manual/en/function.mb-convert-encoding.php

regards

gsnedders
12-16-2008, 06:20 PM
iconv's support is system dependant, and varies depending on the iconv library installed. It tends to be fairly complete, though, and is almost always better than mbstring if it is installed.