views:

390

answers:

3

hello..

i am sending a JSON response through a php script which has some hebrew words.but when i run this script on browser it is showing '?' instead of hebrew characters..

FYI.. database is in hebrew_general_ci collation

any help would be appreciated..

thanks..

A: 

You need to set the appropriate character set in your HTTP Content-Type header for the HTML page that will ultimately display the data contained in your JSON. Try adding this to the top of your php script:

header('Content-Type: text/html; charset="windows-1255"');
Asaph
i am still getting those '?'...
mudit
A: 

Use a content-type header, as others have suggested:

header('Content-Type: text/html; charset=YOUR_CHOSEN_CHARSET');

Try charset=utf8, or charset=iso-8859-8. There's a list of character sets over here.

Ben Werdmuller
i hv tried both UTF-8 and iso-8859-8..but nothing happen..browser is displaying question marks..instead of hebrew characters..
mudit
Have you tried any other from the list supplied above?Namely one of these:Hebrew (DOS) ##charset=DOS-862 Hebrew (ISO-Logical) ##charset=iso-8859-8-i Hebrew (ISO-Visual) ##charset=iso-8859-8 Hebrew (Mac) ##charset=x-mac-hebrew Hebrew (Windows) ##charset=windows-1255
Bloeper
+1  A: 

you may not included appropriate CSS file. also charset variable is another problem while using native languages. use Utf-8 if you are using a unicode font like

also problem may occur, if the created eot font is not good. i am not sure Hebrew need such font.

riyas kp
i am not using any CSS file.it is just a simple php script that is running on a LAMP server..it fetches some data(which contains both English and Hebrew words) from database and show it on the browser.(response is in JSON format)
mudit