xom-interest AT lists.ibiblio.org
Subject: XOM API for Processing XML with Java
List archive
[XOM-interest] invalid byte 2 of 3 byte UTF-8 error received
- From: Sandy Mustard <smustard AT cinci.rr.com>
- To: xom-interest AT lists.ibiblio.org
- Subject: [XOM-interest] invalid byte 2 of 3 byte UTF-8 error received
- Date: Mon, 23 Sep 2013 20:15:41 -0400
I have some text that I need to convert to xml. The text is:
"Ing. Libor Vos\xe1hlo\nSenior project manager\nforteq Czech\nKopisty 1- areal MUS,a.s.\nCZ - 43401, Most - Kopisty\nTel: +420 476 203 826\nFax: +420 476 203 835\nMobil: +420 602 109 446\n"
I am converting the "\n" sequences to new lines (x0a).
Note the character sequence that is \xe1. I convert this sequence with a character with a value of 225 (xe1).
I am using XOM to create the XML
Attribute attr = new Attribute("Text", textString);
xmlClass.addAttribute(attr);
and here is the output:
<MyElem Text="Ing. Libor Vosáhlo
Senior project manager
forteq Czech
Kopisty 1- areal MUS,a.s.
CZ - 43401, Most - Kopisty
Tel: +420 476 203 826
Fax: +420 476 203 835
Mobil: +420 602 109 446
" />
Note the correct last name in the data (with the á)
However, when reading this in various XML parsers, I get a "java.io.UTFDataFormatException: Invalid byte 2 of 3-byte UTF-8 sequence" error.
How do I pass this string to XOM to get the correct UTF-8 encoding?
Thank you.
Sandy Mustard
-
[XOM-interest] invalid byte 2 of 3 byte UTF-8 error received,
Sandy Mustard, 09/23/2013
- Re: [XOM-interest] invalid byte 2 of 3 byte UTF-8 error received, Sandy Mustard, 09/23/2013
Archive powered by MHonArc 2.6.24.