Method toJSONObject of org.json.XML cannot hold capitalized accented letters

Viewed 82

I'm having an XML to JSON transformation issue. It happens that I'm trying to transform an XML string into a JSONObject using method toJSONObject of class org.json.XML.

The thing is that such method does not hold accented capital letters during the transformation. For example, if the XML contains the word “HellÓ”, it transforms it to “Helló” in the JSON. It holds the accent, but not the capital letter.

In my code I got:

import org.json.JSONException;
import org.json.JSONObject;
import org.json.XML;

...

try {
   JSONObject xmlJSONObj = XML.toJSONObject(this.xmlString);
   ...
}

Any recommendations to solve this problem using this same library?

0 Answers
Related