You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jaxme-dev@ws.apache.org by K Grindley <ea...@merseymail.com> on 2007/12/18 16:42:52 UTC
Problem marshalling/unmarshalling UTF-8 document containing a pound symbol
Hi,
I am trying to marshal a document whose content contains an embedded '�'
symbol. The document is
marshalled using UTF-8 encoding and I would have expected the '�' to have
been rendered as
a valid Xml artifact (escaped). However, editing the source document
confirms that the '�' is written
literally. When I try to unmarshal the same document I get the following
message:
Caused by: javax.xml.bind.JAXBException: Parsing error. Invalid byte 1 of
1-byte UTF-8 sequence.
I must confess I don't really understand this message: does this mean JAxMe
is only expecting a
one-byte UTF-8 stream? I thought UTF-8 and therefore JAxMe could handle
multi-byte character encoding?
Do I have to write a specific XMLWriter to escape this (and other) symbols
or have I missed something fundamental?
Any help would begratefully received.
Regards
--------------------------------------------------------------------
Get your free email address at http://www.merseymail.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: jaxme-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: jaxme-dev-help@ws.apache.org
Re: Problem marshalling/unmarshalling UTF-8 document containing a pound symbol
Posted by Jochen Wiedmann <jo...@gmail.com>.
On Dec 18, 2007 4:42 PM, K Grindley <ea...@merseymail.com> wrote:
> symbol. The document is
> marshalled using UTF-8 encoding and I would have expected the '£' to have
> been rendered as
> a valid Xml artifact (escaped). However, editing the source document
> confirms that the '£' is written
> literally. When I try to unmarshal the same document I get the following
> message:
This error message is not created by JaxMe, but by the XML parser.
Most possibly, the fault is on your side. A typical reason would be,
that you have an UTF-8 encoded file and parse it by creating a
FileReader, but not a FileInputStream.
Jochen
--
Look, that's why there's rules, understand? So that you think before
you break 'em.
-- (Terry Pratchett, Thief of Time)
---------------------------------------------------------------------
To unsubscribe, e-mail: jaxme-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: jaxme-dev-help@ws.apache.org