Cannot Convert Json Data Properly
So i am trying to fetch some json data from this api : https://opentdb.com/api_config.php for my quiz app, by using volley library. But the problem is , it is sometimes returning a
Solution 1:
" is not a valid character in JSON. You have to convert such characters yourself or use a library such as apache commons.
data.replace(/"/g,'"')
OR
org.apache.commons.lang.StringEscapeUtils.unescapeHtml4(data);
Alternatively, use a library such as gson for parsing JSON effectively. As far as I remember gson by default handles HTML encoding characters.
Post a Comment for "Cannot Convert Json Data Properly"