我开发了一些应用程序从json在阿拉伯语中从facebook检索帖子..但是阿拉伯语中的所有数据都是用不知名的方法编码的,就像在标题和内容中一样:
https://www.facebook.com/feeds/page.php?id=103622369714881&format=json
"title": " #رصد | بيان هام: تعلن شبكة رصد الإخبارية عن قائمة بالمواقع والحسابات الرسمية الت...",
"id": "392844a43334c611060f3401300948dc",
"alternate": "https:\/\/www.facebook.com\/photo.php?fbid=597021777041602&set=a.280183138725469.58204.103622369714881&type=1",
"categories": [
],
"published": "2013-09-05T03:39:59+01:00",
"updated": "2013-09-05T03:39:59+01:00",
"author": {
"name": "R.N.N | شبكة رصد"
},
"verb": "",
"target": "",
"objects": "",
"comments": "",
"likes": "",
"content": "\u202b#\u0631\u0635\u062f | \u0628\u064a\u0627\u0646 \u0647\u0627\u0645: \u062a\u0639\u0644\u0646 \u0634\u0628\u0643\u0629 \u0631\u0635\u062f \u0627\u0644\u0625\u062e\u0628\u0627\u0631\u064a\u0629 \u0639\u0646 \u0642\u0627\u0626\u0645\u0629 \u0628\u0627\u0644\u0645\u0648\u0627\u0642\u0639 \u0648\u0627\u0644\u062d\u0633\u0627\u0628\u0627\u062a \u0627\u0644\u0631\u0633\u0645\u064a\u0629 \u0627\u0644\u062a\u064a \u062a\u0645\u062b\u0644\u0647\u0627 \u0648\u0647\u064a \u0643\u0627\u0644\u062a\u0627\u0644\u064a:\u003Cbr \/> \u003Cbr \/> \u0645\u0648\u0642\u0639 \u0631\u0635\u062f : \u202c\u003Ca href=\"http:\/\/www.facebook.com\/l.php?u=http\u00253A\u00252F\u00252Fwww.rassd.com&h=9AQGoR_rF&s=1\" rel=\"nofollow nofollow\" target=\"_blank\" onmouseover=\"LinkshimAsyncLink.swap(this, "http:\\\/\\\/www.rassd.com\\\/");\" onclick=\"LinkshimAsyncLink.referrer_log(this, "http:\\\/\\\/www.rassd.com\\\/", "https:\\\/\\\/www.facebook.com\\\/si\\\/ajax\\\/l\\\/render_linkshim_log\\\/?u=http\\u00253A\\u00252F\\u00252Fwww.rassd.com&h=9AQGoR_rF&s=1");\">www.rassd.com\u003C\/a>\u202b\u003Cbr \/> \u003Cbr \/> \u0641\u064a\u0633 \u0628\u0648\u0643: \u202c\u003Ca href=\"http:\/\/www.facebook.com\/RNN.NEWS\" rel=\"nofollow\">www.facebook.com\/RNN.NEWS\u003C\/a>\u202b\u003Cbr \/> \u003Cbr \/> \u062a\u0648\u064a\u062a\u0631 : \u202c\u003Ca href=\"https:\/\/www.facebook.com\/l.php?u=https\u00253A\u00252F\u00252Ftwitter.com\u00252FRassd_News&h=BAQEvhv1v&s=1\" rel=\"nofollow nofollow\" target=\"_blank\" onmouseover=\"LinkshimAsyncLink.swap(this, "https:\\\/\\\/twitter.com\\\/Rassd_News");\" onclick=\"LinkshimAsyncLink.referrer_log(this, "https:\\\/\\\/twitter.com\\\/Rassd_News", "https:\\\/\\\/www.facebook.com\\\/si\\\/ajax\\\/l\\\/render_linkshim_log\\\/?u=https\\u00253A\\u00252F\\u00252Ftwitter.com\\u00252FRassd_News&h=BAQEvhv1v&s=1");\">https:\/\/twitter.com\/Rassd_News\u003C\/a>\u202b\u003Cbr \/> \u003Cbr \/> \u064a\u0648\u062a\u064a\u0648\u0628 : \u202c\u003Ca href=\"http:\/\/www.facebook.com\/l.php?u=http\u00253A\u00252F\u00252Fwww.youtube.com\u00252Fuser\u00252Frnnnews1&h=qAQEC53Ud&s=1\" rel=\"nofollow nofollow\" target=\"_blank\" onmouseover=\"LinkshimAsyncLink.swap(this, "http:\\\/\\\/www.youtube.com\\\/user\\\/rnnnews1");\" onclick=\"LinkshimAsyncLink.referrer_log(this, "http:\\\/\\\/www.youtube.com\\\/user\\\/rnnnews1", "https:\\\/\\\/www.facebook.com\\\/si\\\/ajax\\\/l\\\/render_linkshim_log\\\/?u=http\\u00253A\\u00252F\\u00252Fwww.youtube.com\\u00252Fuser\\u00252Frnnnews1&h=qAQEC53Ud&s=1");\">www.youtube.com\/user\/rnnnews1\u003C\/a>\u202b \u003Cbr \/> \u003Cbr \/> \u0628\u0627\u0644\u0625\u0636\u0627\u0641\u0629 \u0625\u0644\u064a \u0635\u0641\u062d\u0627\u062a\u0647\u0627 \u0627\u0644\u0646\u0627\u0637\u0642\u0629 \u0628\u0627\u0644\u0644\u063a\u0627\u062a \u0627\u0644\u0645\u062e\u062a\u0644\u0641\u0629 \u0648\u0627\u0644\u0635\u0641\u062d\u0627\u062a \u0627\u0644\u0645\u062a\u062e\u0635\u0635\u0629 \u0627\u0644\u0645\u0636\u0627\u0641\u0629 \u0641\u064a \u0642\u0627\u0626\u0645\u0629 \u0625\u0639\u062c\u0627\u0628\u0627\u062a \u0627\u0644\u0635\u0641\u062d\u0629 \u0627\u0644\u0631\u0633\u0645\u064a\u0629 \u0639\u0644\u0649 \u0641\u064a\u0633 \u0628\u0648\u0643.\u003Cbr \/> \u003Cbr \/> \u0648\u0623\u064a \u0631\u0648\u0627\u0628\u0637 \u063a\u064a\u0631 \u0630\u0644\u0643 \u0647\u064a \u0625\u062d\u062a\u064a\u0627\u0644 \u0648\u0627\u0633\u062a\u063a\u0644\u0627\u0644 \u0644\u0627\u0646\u062a\u0634\u0627\u0631 \u0627\u0633\u0645 \u0627\u0644\u0634\u0628\u0643\u0629 \u0648\u0634\u0647\u0631\u062a\u0647\u0627 \u0648\u0633\u0631\u0642\u0629 \u0644\u0645\u0644\u0643\u064a\u062a\u0647\u0627 \u0627\u0644\u0641\u0643\u0631\u064a\u0629 \u0648\u0639\u0644\u0627\u0645\u062a\u0647\u0627 \u0627\u0644\u0645\u0633\u062c\u0644\u0629 \u0645\u062d\u0644\u064a\u0627\u064b \u0648\u062f\u0648\u0644\u064a\u0627\u064b.\u003Cbr \/> \u003Cbr \/> \u0631\u0635\u062f .. \u0625\u0639\u0644\u0627\u0645 \u064a\u0635\u0646\u0639\u0647 \u0627\u0644\u062c\u0645\u0647\u0648\u0631\u202c\u003Cbr\/>\u003Cbr\/>\u003Ca href=\"https:\/\/www.facebook.com\/photo.php?fbid=597021777041602&set=a.280183138725469.58204.103622369714881&type=1&relevant_count=1\" id=\"\" title=\"\" target=\"\" onclick=\"\" style=\"\">\u003Cimg class=\"img\" src=\"https:\/\/fbcdn-photos-a-a.akamaihd.net\/hphotos-ak-ash4\/264524_597021777041602_1616125455_s.jpg\" alt=\"\" \/>\u003C\/a>"
},
我在解析时使用了UTF-8但它没有改变任何东西--jist解码这个代码
\u0635\u0641\u062d\u0627\u062a\u0647\u0627 \u0627\u0644\u0646\u0627\u0637\u0642\u0629 \u0628\u0627\u0644\u0644\u063a\u0627\u062a \u0627\u0644\u06
但此代码未解码
#رصد | بيان هام: تعلن شبكة رصد الإخبارية عن قائمة
现在我如何解码该代码并解码html标签?
提前致谢
答案 0 :(得分:1)
值为HTML entities,表示像这样的字符串
بيان
会像这样出现
بيان
直接在HTML文档中使用。就像使用
在<p>
块中创建额外空格一样。
答案 1 :(得分:-1)
我做了这个功能,它工作了:) 这适用于使用curl发布
public function decaodeingthis($url,$postData){
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postData);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$output = curl_exec($ch); return $output;
curl_close($ch);
}
这用于解码:
$arraq = array('html_input'=>'encoded text here','submit'=>'Decode text','bAjax'=>1);
$title = self::decaodeingthis('http://www.web2generators.com/html/entities',$arraq);