json中的自动转义引号 [英] automatic escape quotes in json

查看:170
本文介绍了json中的自动转义引号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从服务器我得到json。杰森很大。我展示了一小部分



...

 {
id: 9429531978965160,
name:Morning inParis,// json.net无法反序列化此行,因为行没有转义引号。
alias:ThisAlias



},



....





解析值后遇到意外字符:L。路径'结果[16] .children [7] .name',行1,位置51081.

解决方案

看起来服务器给你错误的json。你可以在这里轻松查看json:

http://jsonlint.com/ [ ^ ]



祝你好运!


使用此\字符串转义。



 {
id:9429531978965160,
name:早上在\Paris \,
alias:ThisAlias

},


From server i get json. Json is very big. I show litle piece of this

...

{
                    "id": "9429531978965160",
                    "name": "Morning in  "Paris"",  // json.net cannot deserialize this line, because line have no escaped quotes.
                    "alias": "ThisAlias"


},

....


After parsing a value an unexpected character was encountered: L. Path 'result[16].children[7].name', line 1, position 51081.

解决方案

Looks like the server gives you faulty json. You can easily check the json here:
http://jsonlint.com/[^]

Good luck!


use this \" string escape .

{
                    "id": "9429531978965160",
                    "name": "Morning in  \"Paris\"",  
                    "alias": "ThisAlias"

},


这篇关于json中的自动转义引号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆