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

tutufool opened this Issue Jan 18, 2013 · 0 comments


None yet
1 participant


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?

Ma Ling

tutufool pushed a commit to tutufool/protobuf-codec that referenced this issue Jan 22, 2013

fix bugs:
XML codec throw java.util.NoSuchElementException when message is too long

XML codec failed due to special charecter like '\u0000'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment