• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Charset / Encoding problem when reading XML

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Eclipse IDE Debian Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic