I have a JSON response from a server. It looks somehow like this:
"json_key" : {
"key_1" : value,
"key_2" : json_object,
"key_3" : json_object
}
The problem is that one of the json objects comes in a specific encoding
"object_key": "a:4:{s:6:\"ITEM_KEY_1\";s:2:\"ITEM_VALUE_1\";s:6:\"ITEM_KEY_2\";s:2:\"ITEM_VALUE+2\";s:8:\"ITEM_KEY_3\";s:8:\"ITEM_VALUE_3\";s:8:\"ITEM_KEY_4\";s:5:\"ITEM_VALUE_4\";}"
As I understand it's an json_encoded string. How can I convert it to a java JSONObject?
Asking this because when I try the usual way JSONObject json = new JSONObject(jsonStr); it throws a JSONException - cant convert String to JSONObject.
Edit Every validation tool see the objects value as a string, not a JSON.
a:4:{s:6:\"ITEM_KEY_1\"...is not a json encoded. It's some other encoding format.