开发者

arabic characters appears as ??????? ?????? in json format. iphone

开发者 https://www.devze.com 2023-02-01 13:18 出处:网络
I am getting Arabic characters as ????? in return from JSON. Can anyone tel me how to get Arabic ch开发者_运维问答aracters right in JSON format?

I am getting Arabic characters as ????? in return from JSON.

Can anyone tel me how to get Arabic ch开发者_运维问答aracters right in JSON format?

EDIT: I am using English language. I also have tried encoding it to UTF8.

Many Thanks, Naveed


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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号