Hi list

I’ve run into a problem with serializing a cas in UTF-16 encoding. I use the 
following code:
> XMLSerializer xmlSerializer = new XMLSerializer(pw);
> xmlSerializer.setOutputProperty(OutputKeys.ENCODING, "UTF-16");
> XmiCasSerializer xmiCasSerializer = new XmiCasSerializer(cas.getTypeSystem());
> xmiCasSerializer.serialize(cas.getCas(), xmlSerializer.getContentHandler());
When I try to deserialize this code with the CasIOUtils.load(…) method I get an 
exception:
> [Fatal Error] :1:40: Content is not allowed in prolog.


If I set the encoding to UTF-8 there’s no issue.

Best,
Rune

Reply via email to