<?xml version="1.0" encoding="UTF-8"?>
I'll put just some extract of codes, that i think are meaningful.
I'm reading some information from one xml via http request, something like this :
// defaultHttpClient
DefaultHttpClient httpClient = new DefaultHttpClient();
HttpPost httpPost = new HttpPost(url);
HttpResponse httpResponse = httpClient.execute(httpPost);
HttpEntity httpEntity = httpResponse.getEntity();
xml = EntityUtils.toString(httpEntity);
if i print the string xml to the screen i can see some problems with the codification already
then to return a document i have this
Document doc = null;
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
InputSource is = new InputSource();
is.setCharacterStream(new StringReader(xml));
doc = db.parse(is);
Although i'm fetching correctly the information from http request, i'm having problems with the enconding of the characters when i'm showing the data.
I already tried to do is.setEncoding("UTF-8") but didn't work.