是否JSON支持阿拉伯字符? [英] Does json support arabic characters?
本文介绍了是否JSON支持阿拉伯字符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我要问简单的问题,是JSON支持阿拉伯字符我的意思是,当我搜索类似以下
$值= $数据库 - > get_by_name('معا');
回声json_en code(阵列('returnedFromValue'=> $价值。< BR />中));
也是我正在寻找从数据库阿拉伯结果,返回的值将是这样
<$p$p><$c$c>{"returnedFromValue":"\u0627\u0644\u0645\u0639\u0627\u062f\u0649<br\/>"}{"returnedFromValue":"\u0627\u0644\u0645\u0639\u0627\u062f\u0649<br\/>"}
我在这里缺少什么?是它更好地使用XML的支持阿拉伯字符期限
解决方案
JSON 是,只是如XML,某种类型的数据交换格式。它不是沉迷于一个特殊的字符集,所以阿拉伯字符应该是罚款,如果u使用支持这些字符的字符集(的 UFT-8 为例)。
i want to ask quick question, is json support arabic characters i mean when i search for something like following
$values = $database->get_by_name('معاً');
echo json_encode(array('returnedFromValue' => $value."<br/>"));
also I'm looking for arabic result from the database, the returned values will be like this
{"returnedFromValue":"\u0627\u0644\u0645\u0639\u0627\u062f\u0649<br\/>"}{"returnedFromValue":"\u0627\u0644\u0645\u0639\u0627\u062f\u0649<br\/>"}
what I'm missing here ? is it better to use XML in term of supporting the arabic characters
解决方案
JSON is, just like XML, some kind of data-interchange-format. it's not addicted to a special charset, so arabic characters should be fine if u use a charset that supports these characters (UFT-8 for example).
这篇关于是否JSON支持阿拉伯字符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文