This week's book giveaways are in the Scala and Android forums.
We're giving away four copies each of Machine Learning Systems: Designs that scale and Xamarin in Action: Creating native cross-platform mobile apps and have the authors on-line!
See this thread and this one for details.
Win a copy of Machine Learning Systems: Designs that scale this week in the Scala forum
or Xamarin in Action: Creating native cross-platform mobile apps in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Charset / Encoding problem when reading XML  RSS feed

 
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?

 
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.
 
He was giving me directions and I was powerless to resist. I cannot resist this tiny ad:
Rocket Oven Kickstarter - from the trailboss
https://coderanch.com/t/695773/Rocket-Oven-Kickstarter-trailboss
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!