posted 13 years ago
Hello,
I have a problem with encoding in my project.
I am developing a proxy, I get remote files. xml.
Some of these have UTF-8 encoding (the type of coding that I intend to return to the client).
Other, different encoding (ISO-8859-1).
The xml returned by remote is converted to json from inputStream in this way.
JSON json = new XMLSerializer (). readFromStream (res.getEntity (). getContent ());
In particular,
Code:
res.getEntity (). getContent ()
returns, as mentioned, the inputStream of the response.
I simply wish to specify the inputStream encoding , so that the json obtained from the XML is correctly displayed in my client that uses encoding as UTF-8.
Specifically, without being able to change the charset, the client (UTF-8) does not correctly display the special characters and accented in case the remote XML has the ISO.
Good day,
Adriano.