Im using json-simple to read from JSON files, to alter the attributes inside and to write them back to a file. This a line:
{"username": "M\u00e4nnlich2", "url": "http://www.dslr-forum.de/showthread.php?t=1303001"}
Problem: I get this as a Map when I load them to a JSONObject:
{"username": "Männlich2", "url":"http:\/\/www.dslr-forum.de\/showthread.php?t=1303001"}
I want to keep the coding "M\u00e4nnlich2" and the url shouldnt get escapes.
Is this normal? How can i keep the encoding when I parse it into a JSONObject? Or should I use a different JSON library?
Here is some Example code:
BufferedReader bfr = new BufferedReader(
new InputStreamReader(
new FileInputStream("tt"), "UTF8"));
JSONParser parser=new JSONParser();
JSONObject root=(JSONObject)parser.parse(bfr);
String jsonText = root.toJSONString();
//Here the String has lost the encoding