xmlbeans-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kris16 <krister.o.jons...@tietoenator.com>
Subject Re: Problem with Scandinavian characters åäö
Date Mon, 12 Feb 2007 10:11:12 GMT

Hi, 
I noticed that i had not saved the xml file in UTF-8 formate,
that is why i got the exception java.io.CharConversionException.

To solve the strange characters I used the toString("UTF-8") method to make
the characters appear correct in my console:

ByteArrayOutputStream result = new ByteArrayOutputStream();
newShowItem.save(result, opts);
System.out.println("\nPrint newShowItem.save(result);");
System.out.println(result.toString("UTF-8"));

/Regards Krister



kris16 wrote:
> 
> Hi,
> I am using java 5 and xmlbeans 2.2.0.
> 
> I am trying to read an xml document from file an it works fine.
> The xml file is using UTF-8.
> But when I set a value for an element to contain the Scandinavian
> character "ä" as in Pärsson, then 
> I get the following exception
> <ComponentID schemeName="SourceSystem">Pärsson</ComponentID>:
> java.io.CharConversionException: Malformed UTF-8 character: 0xf6 0x6e 0x73
> 0x73
> 
> If I change the the encoding to ISO-8859-1 then it works but I get the
> following result
> when I print it out:
> <ComponentID schemeName="SourceSystem">Põrsson</ComponentID>
> 
> What am I doing wrong here ?
> Why is not UTF-8 working at all ?
> 
> Why do I get the result Põrsson instead of Pärsson ?
> 
> /Regards Krister
> 

-- 
View this message in context: http://www.nabble.com/Problem-with-Scandinavian-characters-%C3%A5%C3%A4%C3%B6-tf3200981.html#a8921622
Sent from the Xml Beans - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org


Mime
View raw message