json_encode unicode转义序列无法在javascript中显示


json_encode unicode escape sequences cannot display in javascript

json_encode(数组($myarray1,$myarray2((

php上包含类似的unicode转义序列

[{
"Panelbuilder 32":
    [{
        "topic_id":"34",
        "forum_id":"6",
        "topic_title": "Panelbuilder 32",
        "topic_poster":"1",
        "topic_time":"1189740810",
        "topic_last_post_id":"124",
        "topic_last_poster_id":"1",
        "topic_last_poster_name":"vvv",
        "topic_last_post_time":"1189740810",
        "topic_last_post_subject":"Panelbuilder 32",
        "topic_last_view_time":"1436511928",
        "topic_replies":"0",
        "topic_replies_real":"0",
        "topic_views":"2463",
        "topic_attachment":"0",
        "topic_reported":"0",
        "topic_first_post_id":"124",
        "topic_first_poster_name":"vvv"
    }]
}, {
"124":
    [{
        "post_id":"124",
        "topic_id":"34",
        "forum_id":"6",
        "poster_id":"1",
        "poster_ip":"192.44.136.113",
        "post_time":"1189740810",
        "post_approved":"1",
        "post_reported":"0",
        "post_username":"vvv",
        "post_subject":"Panelbuilder 32",
        "post_text":"'u0e23'u0e03'u0e22'u0e04'u0e23'u0083'u0e23'u0081'u0e23'u0095'u0e22'u0e04'u0e23'u0087'u0e23'u0092'u0e23'u0081'u0e22'u0e0a'u0e23'u0093'u0e22'u0e19'u0e23'u0092'u0e22'u0e0d'u0e23'u0e03'u0e22'u0e19'u0e22'u0e01'u0e23'u0092'u0e23'u0083'u0e23'u0e03'u0e22'u0e0a'u0e23'u0e09'u0e23'u0e02'u0e22'u0e1b'u0e23'u0083'u0e23'u0e01'u0e22'u0e01'u0e23'u0083'u0e23'u0081 Panelbuilder 32 'u0e22'u0e02'u0e23'u008d'u0e22'u0e07  AB",
        "post_attachment":"0",
        "post_edit_time":"0",
        "topic_poster":"1",
        "topic_time":"1189740810",
        "topic_last_post_id":"124",
        "topic_last_poster_id":"1",
        "topic_last_poster_name":"vvv",
        "topic_last_post_time":"1189740810",
        "topic_last_post_subject":"Panelbuilder 32",
        "topic_last_view_time":"1436511928",
        "topic_replies":"0",
        "topic_replies_real":"0",
        "topic_views":"2463",
        "topic_attachment":"0",
        "topic_reported":"0",
        "topic_first_post_id":"124",
        "topic_first_poster_name":"vvv"
    }]
}]

这些unicode序列以类似/ue023(反斜杠转换为正斜杠(的javascript显示,不能显示为字符。我需要在我的phonegap应用程序上显示这些字符。有什么解决办法吗?

正如您所解释的使用JSON.parse是我的解决方案:

var str = JSON.parse(data);
str.replace(/'//g, "''");

显然,无论你得到你的领域,你都需要更新上面的代码,例如

var new_data = str[1][124][0].post_text.replace(/'//g, "''");