Menu

Unable to process XML with 2-byte UTF-8 characters

Help
2014-02-10
2014-02-11
  • Tony Slosar

    Tony Slosar - 2014-02-10

    Hello.
    I have been unable to process an XML document with a few 2-byte UTF-8 characters in it.
    Using CAM Editor 3.3 (CAMV 2.0.4).
    Editor throws
    Exception: com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException
    Message: Invalid byte 1 of 1-byte UTF-8 sequence.

    Below is the file which has been verified to be in UTF-8 format.
    Any help is GREATLY appreciated.
    Kind regards, Tony

     

    Last edit: Tony Slosar 2014-02-10
  • Tony Slosar

    Tony Slosar - 2014-02-10

    Apparently I am having compatibility issues with this forum and Windows 8 Internet Explorer. I removed what I pasted because it was corrupted and am unable to add an attachment.

     
  • drrwebber

    drrwebber - 2014-02-10

    Tony, the trick here is you have to type a TAB character first before inserting the XML source code:

    <OTCPartInvoiceHeader lineNumber="5" lineLength="462" currentFileDate="121001">
        <RecordType>P1</RecordType>
        <InvoiceNumber>PART INV. #1234 </InvoiceNumber>
        <InvoiceDate truncInvoiceDate="121001">20121001</InvoiceDate>
        <LastName>Serlet-Rental #1              </LastName>
        <AddressLine1>52 Doe ¡r¢i£ AVE.   Ñ      ¤  </AddressLine1>
        <AddressLine2>    ¥     Á     Æ    Ê   Õ    </AddressLine2>
        <City>NederlandOIves                </City>
    </OTCPartInvoiceHeader>
    

    but is looks like the file is corrupted - so need to use a ZIP file of the original XML to either attach here - or send to us in email.

    Thanks, David

     
  • Serge Leontiev

    Serge Leontiev - 2014-02-11

    Tony,

    The solution for this issue is very simple. Open CAMed.ini file. The file should be located in the installation folder of the CAM Editor.

    Add following line at the end of the file:

    -Dfile.encoding=UTF8

    Save it and run CAMEditor.

    Please let us know if it helps.

     
  • Tony Slosar

    Tony Slosar - 2014-02-11

    Worked perfectly. Thank you very much.

     

Log in to post a comment.