4

I was created JSON array from json_encode using PHP. I gave my array to json_encode . It's created JSON array very well. And i feed this JSON array to my android apps. When i am gonna read this url at android it's return following EXCEPTION ERROR.

Error parsing data org.json.JSONException: Value  of type java.lang.String cannot be converted to JSONObject

But when i am gonna create jason object at android adding this following line

jObj=new JSONObject(json.substring(json.indexOf("{"), json.lastIndexOf("}") + 1));

It's working perfectly.

But i don't want to need the my second type solution. I need the php solution when i am put my json_encode on php.

And also at IOS the JSON return NULL values. How can i fix in both IOS and Android

Thanks advance

1 Answer 1

1

The java.text.Normalizer is intended to do exactly this: remove unwanted unicode characters.

The normalize method will allow you to pass your CharSequence and return the "normalized", ASCII-only String.

Sign up to request clarification or add additional context in comments.

2 Comments

@tamil_arvu he just added two(2) links for you to read. So follow them and enjoy your reading.
thanks my friend, they all described about how to remove unwanted unicode from string not an array. i give my php array to json_encode it's also php function. here how can i use Normalize ?? and i need this on php side not java.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.