开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜