• Post Reply Bookmark Topic Watch Topic
  • New Topic

XML Parsing -> Character encoding and Euro sign  RSS feed

 
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am trying to parse an XML with a Euro sign (€) in it. I am encountering the following scenarios based on the encoding type being used:
1. UTF-8 Encoding
Error returned: Error : javax.xml.transform.TransformerException: org.xml.sax.SAXParseException: Invalid byte 1 of 1-byte UTF-8 sequence.

2. ISO-8859-1 Encoding
Euro symbol is visible as "?"

3. ISO-8859-15 Encoding
Euro symbol is visible as "?"

According to the information known, encoding ISO-8859-15 supports the Euro symbol .
Why is it that a question mark is being displayed?

I am using WSAD 5.1 as the IDE.
Are there any other seetings I need to consider for parsing XML with specific encodings like JVM character encoding settings or WSAD specific some setting?

Any help in this regard will be highly appreciated.

Thanks & regards,
Anup

 
Sheriff
Posts: 21136
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you mean with "is visible" as "is printed using System.out", then that's your problem - the console simply cannot handle it. Try showing it using JOptionPane.showMessageDialog instead.
 
Anup Bansal
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We tried your suggetion but this does not work.
We tried writing the value to a file and still the Euro sign is displayed as ?.
Also when trying to insert the value into the database that supports cp1252 character set, the value displayed is a ?

What other encoding setting do we have to implement to make this visible.

Kindly help!!
 
Rancher
Posts: 377
Android Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey,

I've had some problems with this and it was due to the JVM's default charset.

The link here gives you information on checking what the default currently is:
http://www.rgagnon.com/javadetails/java-0505.html

Sean
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!