Org.json.JSONException:在1834年的字符字符串未结束 [英] Org.json.JSONException: Unterminated string at character 1834

查看:189
本文介绍了Org.json.JSONException:在1834年的字符字符串未结束的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从获取Web服务的数据,这我解析为JSON字符串。
 在解析我此异常:org.json.JSONException:人品1834年未终止的字符串

I am fetching the data from webservice, which I am parsing to JSON string. While parsing I am this exception: "org.json.JSONException: Unterminated string at character 1834"

我的code是,

String jsonstring=getJSONString(response);

JSONObject json = new JSONObject(jsonstring);

的字符串是,

[{"LotDescription":"David Weekley homes Traditional Collection in Baxter Village offers floor plans featuring innovative design and unsurpassed quality. This charming community combines work, play and living, all within the Village. In Baxter Village, you’ll enjoy:  Parks, playgrounds"}]

据分析,直到单词村官​​和提高例外,而解析YOU&rsquo的; LL。这似乎是一些HTML内容

It is parsing till the word "Village" and the raising the exception while parsing " you’ll " which seems to be some HTML content.

,这是什么解决办法吗?

What is the solution for this?

推荐答案

您需要添加字符 \\ 。结果

[{"LotDescription":\"David Weekley homes Traditional Collection in Baxter Village offers floor plans featuring innovative design and unsurpassed quality. This charming community combines work, play and living, all within the Village. In Baxter Village, you’ll enjoy:  Parks, playgrounds\"}]

这会做。

这篇关于Org.json.JSONException:在1834年的字符字符串未结束的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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