protobuf-codec icon indicating copy to clipboard operation
protobuf-codec copied to clipboard

XML codec failed due to special charecter like '\u0000'

Open tutufool opened this issue 12 years ago • 0 comments

Hi,

I got some exception when trying to using xml codec:

Caused by: com.ctc.wstx.exc.WstxIOException: Invalid null character in text to output at com.ctc.wstx.sw.BaseStreamWriter.writeCharacters(BaseStreamWriter.java:488) at protobuf.codec.xml.XmlWriter.writeFieldValue(XmlWriter.java:68) at protobuf.codec.xml.XmlWriter.writeXml(XmlWriter.java:47) at protobuf.codec.xml.XmlCodec.writeToStream(XmlCodec.java:69) ... 26 more Caused by: java.io.IOException: Invalid null character in text to output at com.ctc.wstx.api.InvalidCharHandler$FailingHandler.convertInvalidChar(InvalidCharHandler.java:51) at com.ctc.wstx.sw.XmlWriter.handleInvalidChar(XmlWriter.java:623) at com.ctc.wstx.sw.BufferingXmlWriter.writeCharacters(BufferingXmlWriter.java:475) at com.ctc.wstx.sw.BaseStreamWriter.writeCharacters(BaseStreamWriter.java:486) ... 29 more

It seems null characters like '\u0000' - '\u0020' can't be rendered correctly.

I'm not sure if it's a bug for woodstox (or it's already fixed in newer version).

Could you please take a look?

Thanks Ma Ling

tutufool avatar Jan 18 '13 14:01 tutufool