我使用PHP从json_encode
创建了JSON数组。我把我的数组给了json_encode
。它非常好地创建了JSON数组。我将这个JSON数组提供给我的Android应用程序。当我要在android上读取这个url时,它会在EXCEPTION ERROR之后返回。
Error parsing data org.json.JSONException: Value  of type java.lang.String cannot be converted to JSONObject
但是当我要在android上创建jason对象时添加以下行
jObj=new JSONObject(json.substring(json.indexOf("{"), json.lastIndexOf("}") + 1));
它工作得很好。
但我不想要我的第二种解决方案。当我把我的json_encode放在php上时,我需要php解决方案。
而且在IOS中,JSON返回NULL值。我如何修复IOS和Android
感谢提前
答案 0 :(得分:1)
java.text.Normalizer
旨在做到这一点:删除不需要的unicode字符。
normalize
方法允许您传递CharSequence
并返回“标准化”,仅限ASCII String
。