Encoding convert from windows-1255 to utf-8 was asked before I know, but I'm still getting different results and I can't solve it.
The first issue is "does php iconv() or mb_convert_encoding() support windows-1255????" While testing, it returns several outputs (playing with the //ignore & //translate) but its not working well at all.
I was looking at mb_list_encodings() output and it doesn't include window-1255... playing and testing mb_detect_encoding() with an windows-1255 input (crawled from the net) doesn't return the good charset...
You should be able to just use strtr with an associative array of characters to convert (the data is available from MSDN, and converted into a PHP array below). Note that in this code, reserved byte values are replaced with the U+FFFD replacement character (
"\xef\xbf\xbd"
).I generated the above code with this PHP script:
taken from http://forums.adelavida.com/?Idx=php&Status=1291168368
I found that the problem is not in the convertion function like iconv, it's in the database connection. the script open connection with latin1 charset by default then when it writes in the table with utf8 strings data enter bad. You must be sure your connection is UTF8 like your data.
With mysql you can see it with
and if it's not UTF8 then set the connection charset
Then everything will be ok with
iconv('ISO-8859-8','UTF-8//IGNORE',hebrev($value));
for visual hebrew to UTF8 or any convertion functionFound this and it worked for me
Source: Expert Exchange