Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!