Value of type java.lang.String cannot be converted to JSONObject
来源:互联网 发布:怎么更新淘宝网新版本 编辑:程序博客网 时间:2024/05/17 02:49
解析jso报Value of type java.lang.String cannot be converted to JSONObject。检查格式无错误。引起原因是由于utf-8的编码BOM头引起
/** * 4.0以下系统处理掉返回json的BOM头 * * @param jsonStr * @return */public static String getJson(String jsonStr) {if (jsonStr != null && jsonStr.startsWith("\ufeff")) {LogUtil.d(tag, "jsonstr.exist(utf-8.BOM),json="+jsonStr, BaseAppCommon.Isdebug);// jsonStr = jsonStr.substring(1);jsonStr = jsonStr.substring(jsonStr.indexOf("{"),jsonStr.lastIndexOf("}") + 1);}return jsonStr;}
4.0以上已有包含处理的代码。
- Value of type java.lang.String cannot be converted to JSONObject
- Value of type java.lang.String cannot be converted to JSONObject
- org.json.JSONException: Value of type java.lang.String cannot be converted to JSONObject
- org.json.JSONException: Value of type java.lang.String cannot be converted to JSONObject
- org.json.JSONException: Value of type java.lang.String cannot be converted to JSONObject
- org.json.JSONException: Value of type java.lang.String cannot be converted to JSONObject
- org.json.JSONException: Value of type java.lang.String cannot be converted to JSONObject
- org.json.JSONException: Value of type java.lang.String cannot be converted to JSONObject
- Android : Value of type java.lang.String cannot be converted to JSONObject 异常
- org.json.JSONException: Value of type java.lang.String cannot be converted to JSONObject
- JSONException: Value of type java.lang.String cannot be converted to JSONObject
- org.json.JSONException: Value of type java.lang.String cannot be converted to JSONObject
- Value of type java.lang.String cannot be converted to JSONObject 错误解决
- org.json.JSONException: Value of type java.lang.String cannot be converted to JSONObject
- org.json.JSONException: Value ok of type java.lang.String cannot be converted to JSONObject:
- org.json.JSONException: Value ok of type java.lang.String cannot be converted to JSONObject: [Caugh
- Json解析异常处理方式(JSONException: Value of type java.lang.String cannot be converted to JSONObject)
- org.json.JSONException: Value of type java.lang.String cannot be converted to JSONArra
- HttpClient 和 HttpURLConnection 共用session
- 第十一次实验任务
- 秒杀多线程第十四篇 读者写者问题继 读写锁SRWLock
- 哪儿不健康,看脸就知道
- OpenCV轮廓---多边形逼近
- Value of type java.lang.String cannot be converted to JSONObject
- (int &)问题
- WinInet API 浅谈
- iBatis动态标签详解
- 如何让别人可以访问我的wamp站点
- html5小球移动
- 初始安卓中的Activity-----打开新的Activity ,不传递参数
- 第11次上机实验
- CDH4 高可用集群指南