On Sun, 4 Mar 2001 14:53:58 -0500, Michael Mealling wrote:
>This is where things got tricky. The APIs in Xerces make you think
>that you'll get a properly converted string out but you don't.
>Node.getNodeValue() gives you a String that contains bytes that are
>still UTF-8 encoded! You have to do this to get 'em into a real Java
>String:
>
> String newCN = new String(query.getCommonName().getBytes(), "UTF-8");
Well, it's clear that the the data is encoded incorrectly if you have to do this.
How do you get the data fed into Xerces? (I understand that you've got a
DOM tree.)
If it comes from reading a file then make sure there's a
<?xml version="1.0" encoding="whatever"?>
at the top of your doc. There may be other ways
to feed Xerces correctly.
(This is not an error of Xerces. It gives nice qute Java strings when asked.
If it gives mess then it was fed incorrectly.
Best regards, Tagunov Anthony
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]