This week's book / license giveaways are in the JDBC and Relational Databases and Java in General forums.
We're giving away four copies each of PostGIS in Action and Java Advanced Topics Training and have the authors on-line!
See this thread and this one for details.
The moose likes XML and Related Technologies and the fly likes XML file parsed with encoding Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "XML file parsed with encoding "ISO-8859-1" but not with "UTF-8"" Watch "XML file parsed with encoding "ISO-8859-1" but not with "UTF-8"" New topic
Author

XML file parsed with encoding "ISO-8859-1" but not with "UTF-8"

Ravikumar Arunachalam
Greenhorn

Joined: Mar 31, 2004
Posts: 3
I am using xerces parser. I could not parse an XML file ( contains some special characters like � ) with encoding "UTF-8" but when i changed it to "ISO-8859-1", its getting parsed.
"UTF-8" encoding is the default encoding type. Also i am under the impression that this encoding will support all the character sets.

Can anyone tell me why this is not getting parsed?


Ravikumar A<br />Programmer Analyst,<br />Cognizant Technology Solutions,<br />Chennai.
Ravikumar Arunachalam
Greenhorn

Joined: Mar 31, 2004
Posts: 3
I would like to add some examples to this.

The xml file working with ISO-8859-1.
<?xml version="1.0" encoding="ISO-8859-1"?>
<note>
<from>Ravi</from>
<to>Kumar</to>
<message>Norwegian: ���. French: ���</message>
<body>Norwegian: ���. French: ���</body>
</note>

XML file not working with UTF-8 encoding
<?xml version="1.0" encoding="UTF-8"?>
<note>
<from>Ravi</from>
<to>Kumar</to>
<message>Norwegian: ���. French: ���</message>
<body>Norwegian: ���. French: ���</body>
</note>

So I want to know whether this ISO-8859-1 encoding covers all the character sets available. Can I use this as the default encoding for the XML files used for my application.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: XML file parsed with encoding "ISO-8859-1" but not with "UTF-8"