users@jaxb.java.net

RE: question about UTF-8 characters

From: Geis, Matt <Matt.Geis_at_schwab.com>
Date: Wed, 20 Aug 2003 15:38:58 -0700

Thanks, Ryan. That worked (actually, the example document worked).
However, that leaves unsolved the fact that JAXB should handle this on its
own, as I'm not asking it to do anything out of the ordinary. All I'm
asking it to do is be able to correctly unmarshall a document (which it does
very well) and marshall it back to xml (which it does well, as long as you
only use ASCII characters).

I'm using J2SE 1.4.2, by the way (the documentation says that 1.3 can be
problematic). The description that "by default, the marshaller
implementation of the JAXB RI tries to escape characters..." may be true,
but "ties to escape" and "escapes" are very different. However, I guess
it's appropriate to use the proprietary extension in this case ("the default
behavior may not meet your expectations" -- I expected it to work, it
doesn't, do I have to use the custom character escaping).

What's even more odd than the bug itself is why the working code provided in
the example isn't in the JAXB RI.

Matt

-----Original Message-----
From: Ryan Shoemaker - JavaSoft East [mailto:Ryan.Shoemaker_at_Sun.COM]
Sent: Wednesday, August 20, 2003 1:51 PM
To: users_at_jaxb.dev.java.net
Subject: Re: question about UTF-8 characters

Geis, Matt wrote:

> Hi,
>
> I'm running into a problem with JAXB. I have an XML document which
> contains the character Æ. More accurately, I have a document which
> contains the character entity reference &#x00C6;, which dereferences to
> Æ. When I unmarshall the document into a JAXB object, I can call the
> getter for the given property, and it correctly displays Æ.
>
> [...snip...]
>
> What do I need to do here? Is this a bug? If not, how to I correctly
> marshall the data?
>
>

Have you investigated the character escape handler feature[1] in JAXB 1.0.1?
It's a Sun RI specific feature, but it might solve your problem...

--Ryan

[1] http://java.sun.com/webservices/docs/1.2/jaxb/vendorProperties.html



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
For additional commands, e-mail: users-help_at_jaxb.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
For additional commands, e-mail: users-help_at_jaxb.dev.java.net