[jdom-interest] special characters and JDOM

Andrew Freeman aefreeman at earthlink.net
Fri Jul 20 17:17:46 PDT 2001


I am trying to use JDOM to parse an XML file that contains the following
character:  '–'.  However, I am getting a parsing error indicating that that
Unicode character is invalid.

When I print it out in Java:

System.out.println("" + (int) '–');

I get 8211.

If I print out its ASCII character in another editor I get 150.

Does the XML file need a specific encoding in order to parse the file?  Do I
need to have the character escaped with – prior to parsing the file?
If I need to escape the character, is there a rule that tells me what I have
to escape and what I don't?  Also, what is special about this character that
it has such a funky int value when I print it out?

Thanks,
Andy




More information about the jdom-interest mailing list