[jdom-interest] About encoding in jdom-b8
Alex Rosen
arosen at silverstream.com
Tue Jul 23 11:24:04 PDT 2002
> Hi,
> I met some strange results when I use encoding in jdomb8.
> Summary of the problem:
> 1. read the source xml. Just read the xml element text but found that
> ’ — …...... are all turned into ASCII code 63.
> 2. encode the string which is read from the source xml with
> XMLOutputter.
> But found that all the code above are prefixed with ASCII
> code 194.
These both indicate that you're using the wrong encodings, and need to learn
more about how encodings work. 194 is C2 in hex, which is a common value for
the first half of a character encoded with UTF-8 (this character is encoded
in 2 bytes in this case). So you're outputting in UTF-8, which obviously
isn't what you're expecting. Read more about Unicode and the various
encodings, e.g. http://www.cl.cam.ac.uk/~mgk25/unicode.html
Alex
More information about the jdom-interest
mailing list