org.json.JSONException:737处的无终止字符串[字符738第1行] [英] org.json.JSONException: Unterminated string at 737 [character 738 line 1]

查看:71
本文介绍了org.json.JSONException:737处的无终止字符串[字符738第1行]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用org.json.JSONObject解析由iphone发送到我的servlet的一些json.为什么我总是收到一条错误消息,所以我被困了一段时间.错误消息是:

I'm using the org.json.JSONObject to parse some json being sent to my servlet by an iphone. I was stuck for a while by why I would be getting an error message at all. The error message was:

org.json.JSONException:737 [字符738第1行]处的未终止字符串

org.json.JSONException: Unterminated string at 737 [character 738 line 1]

在打印出我收到的内容之后,我发现发送的字符串确实被缩短并在json中停了下来.我不明白为什么要删减它.那里的字符串大小没有限制(或者至少肯定只有一个内存限制).

After printing out what I received, I see that the string sent was indeed cut short and stopped mid-json. I can't understand why it would be cut short. There's no limit on String size is there (or at least only a memory limit surely).

还有其他人有稀释错误吗?

Has anyone else had thins error?

欢呼

推荐答案

json与\ n兼容,但是如果您的消息中还有其他特殊字符,例如 \,@,& ,#等.首先将它们转换为各自的十六进制值,然后发送消息.

json work well with \n but if you have any other special charachters in your meesage like \ , @ , & , # etc.. first convert them into their respective HEX value and then send your message.

这篇关于org.json.JSONException:737处的无终止字符串[字符738第1行]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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