Flux RSS modifier encoding
Bonjour à tous ,
Voici mon code qui me permets de lire un flux Rss :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| try {
DocumentBuilder docBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
InputStream in = url.openStream() ;
Document doc = docBuilder.parse(new InputSource(in));
doc.getDocumentElement().normalize();
NodeList nodeList = doc.getElementsByTagName("title");
for (int i = 0; i < nodeList.getLength(); i++) {
Node node = nodeList.item(i);
... |
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| try {
for(BfcZoom aff :result)
{
if(!(aff.getTitre()==result.get(0).getTitre()))
{
map = new HashMap<String, String>();
map.put("titre", aff.getTitre().toString());
map.put("description", aff.getDescription().toString());
listItem.add(map);
}
else
{
TextViewTitre.setText(aff.getTitre());
}
}
} catch (Exception e) {
Log.e("TAG","XML parsing errror",e);
} |
Mais je n'arrive pas à lire les accents et autre symbole.
J'aimerais passer de UTF8 à ISO-8859-1
Comment puis-je faire?
Merci d'avance