[jdom-interest] CDATA inconsistency

Elliotte Rusty Harold elharo at metalab.unc.edu
Sun Nov 3 04:12:52 PST 2002

At 9:22 PM -0800 11/2/02, Malachi de AElfweald wrote:
>Ok, so the real issue is that the characters are being added as
>binary data instead of as Java chars then?

No. It's not. The problem is that a Java char is not a Unicode 
character and thus not an XML character.

>That would mean that
>grabbing the data from the initial source would be the problem?

Not really.

>So, if the original data were grabbed via a BufferedReader via
>an InputStreamReader using the correct encoding, would that not
>make sure that the data had the correct surrogate pairs internally,
>since they would all be valid Java characters?

A Reader might fix this, but might not, depending on what the 
original encoding was.

| Elliotte Rusty Harold | elharo at metalab.unc.edu | Writer/Programmer |
|          XML in a  Nutshell, 2nd Edition (O'Reilly, 2002)          |
|              http://www.cafeconleche.org/books/xian2/              |
|  http://www.amazon.com/exec/obidos/ISBN%3D0596002920/cafeaulaitA/  |
|  Read Cafe au Lait for Java News:  http://www.cafeaulait.org/      |
|  Read Cafe con Leche for XML News: http://www.cafeconleche.org/    |

More information about the jdom-interest mailing list