[jdom-interest] non-ascii characters in xml document

Jason Hunter jhunter at acm.org
Thu Nov 29 14:18:47 PST 2001


> I'm working on an application, in which the user is allowed to paste
> text into a JTextArea. The text can include "curly" single and double
> quotes, and presumably other non-ascii characters. When the text is
> written to an xml file from a jdom Document, each such character is
> replaced in the file with some other non-ascii character. I tried
> changing the encoding from the default UTF-8 to ISO-8859-1, but the
> result is that now the replacement character is always a question mark.

If you're using UTF-8, all Unicode characters can and will be
represented and you'll have them nicely encoded in UTF-8 format.  If it
shows up as a ? for you, it's probably because your viewer isn't
recognizing that the characters are encoded as UTF-8, or it doesn't have
the glyph necessary to display the chars.

-jh-



More information about the jdom-interest mailing list