• Post Reply Bookmark Topic Watch Topic
  • New Topic

Charset / Encoding problem when reading XML

 
Jeppe Mariager
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey all,

We're making an import functionality for our CMS, and it needs to import some things from a XML feed (RSS to be more specific)... The encoding of the XML is (and cannot be changed) ISO-8859-1, but when we read it, i think that it reads it as UTF-8... Anyone know how we can make the ISO-8859-1 chars work?

 
Carey Evans
Ranch Hand
Posts: 225
Debian Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you open the URL yourself (with openStream()), wrap the InputStream with an InputStreamReader explicitly using ISO-8859-1, and pass that to JDOM with url.toString() as the system ID, then you can override the standard XML encoding detection.

If it really is ISO-8859-1, it should start with:so that you don't have to do this.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!