[jdom-interest] Character encodings...
jhunter at servlets.com
Sun Sep 29 20:44:30 PDT 2002
I don't have a good answer except you're right it's an encoding issue.
I'd guess your content is in a multibyte encoding and your parser is
treating the content as a single-byte or UTF-8 encoding. Look at the
XML file declarations and the character content and make sure the char's
encoding is appropriate for the declaration at every step.
Or stop using left double quotes. :-)
Mark Schmeets wrote:
> Hi All,
> I know this must be a character encoding problem, but I am at wits end
> trying to figure out where I am making the mistake.
> I have a Swing application which programatically converts CSV files
> (produced on an NT client) creates a JDOM document, posts that document to a
> servlet which passes the JDOM to a builder class which in turn creates sql
> statements to insert the records into an Oracle database. So far, so good,
> Another part of the system contains an applet which posts a request to a
> servlet (that queries the database, creates a JDOM document with the
> resultset) and then displays the data.
> Touches a lot of stuff here, I know. The problem character is the left
> double quotation mark character. In the CSV file it shows up as 0x93 which
> matches the Windows 1252 codepage map, also as U+201C.
> My applet throws a SAXParseException for an illegal xml character : .
> Ok, I see that is "half" of the unicode value for the character, but I do
> not understand why I am getting the error.
> I have looked at the XML on the input side, no apparent problems there.
> On the output side the data comes from JDBC, and I am I am specifying UTF-8
> as the encoding for the XMLOutputter. The InputStreamReader that is created
> on the applet is also specified for UTF-8. So, it seems like the output side
> should be ok, but to me it looks like we are dropping part of the unicode
> value (the 20), and just passing the 1C.
> Any suggestions, as to what I am doing wrong?
> Chat with friends online, try MSN Messenger: http://messenger.msn.com
> To control your jdom-interest membership:
More information about the jdom-interest