Announcement

Collapse
No announcement yet.

DocumentWriter - RTF fails on certain characters

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • DocumentWriter - RTF fails on certain characters

    Hello,

    A good chance this will end up in jira, but I wanted to check here first and see if I'm missing something. I hate to bring anyone else into character encoding hell since I've been there quite a bit myself, but a customer is requesting this and I'm forced to do a text replace in mirth and then outside of mirth until I figure this out..

    javascript reader:
    return "test";
    document writer:
    rtf
    ${message.encodedData}

    works fine. produces my rtf document with "test" in it no problem.

    javascript reader:
    return "test®";
    document writer:
    rtf
    ${message.encodedData}

    same as before except with the ® character. Now this always fails with

    ERROR-401: Document connector error
    ERROR MESSAGE: Error writing document
    ExceptionConverter: org.apache.xerces.impl.io.MalformedByteSequenceExc eption: Invalid byte 1 of 1-byte UTF-8 sequence.
    at org.apache.xerces.util.ErrorHandlerWrapper.createS AXParseException(Unknown Source)
    at org.apache.xerces.util.ErrorHandlerWrapper.fatalEr ror(Unknown Source)
    at org.apache.xerces.impl.XMLErrorReporter.reportErro r(Unknown Source)
    at org.apache.xerces.impl.XMLErrorReporter.reportErro r(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerI mpl$FragmentContentDispatcher.dispatch(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerI mpl.scanDocument(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse (Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse (Unknown Source)
    at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
    at org.apache.xerces.parsers.AbstractSAXParser.parse( Unknown Source)
    at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser .parse(Unknown Source)
    at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source)
    at com.lowagie.text.html.HtmlParser.go(Unknown Source)
    at com.mirth.connect.connectors.doc.DocumentMessageDi spatcher.writeDocument(DocumentMessageDispatcher.j ava:170)
    at com.mirth.connect.connectors.doc.DocumentMessageDi spatcher.doDispatch(DocumentMessageDispatcher.java :90)
    at com.mirth.connect.connectors.doc.DocumentMessageDi spatcher.doSend(DocumentMessageDispatcher.java:180 )
    at org.mule.providers.AbstractMessageDispatcher.send( AbstractMessageDispatcher.java:164)

    It seems like any extended character will do that. AND I end up with a blank document. So two things, the connector needs to handle these characters, and if an error occurs, it should not leave an empty document on disk.

    Changing the type to PDF works fine including the ® character. So it could be an issue with the itext library, or the way mirth is passing data to itext is different from rtf vs pdf.

    Any workarounds or thoughts? Should I go to jira and attach a test case channel?

    Thanks!
Working...
X