Reputation: 2643
I am getting Arabic characters as ????? in return from JSON.
Can anyone tel me how to get Arabic characters right in JSON format?
EDIT: I am using English language. I also have tried encoding it to UTF8.
Many Thanks, Naveed
Upvotes: 2
Views: 807
Reputation: 125
I have searched the solution by myself.
Solution is just call the set names to utf8 after connecting to DB like this:
$host_link = mysql_connect(DBASE_HOST, DBASE_USER, DBASE_PWD); if (!$host_link) { die('Could not connect: ' . mysql_error()); exit;
} mysql_query("SET NAMES utf8; ");
Hope this will help some others. Naveed
Upvotes: 4