KB Article #178124
Byte Order Mark fails EDI X12 parsing
Problem
-- On a Pickup exchange, the "Always parse for the address." option is enabled for Sender and/or Receiver
-- Parsing of EDI X12 message fails to retrieve correct sender and receiver from the ISA header of the message
-- Message is using UTF-8
-- Inspected with Hex Editor, the first bytes of the file are "EF BB BF"; Known as Byte Order Mark (BOM)
-- Error message in Interchange 5.10.1:
(X12Parser.getFormatInputStream:232) - Unable to determine or build proper X12 document CharacterFormatInputStream
com.cyclonecommerce.collaboration.parsers.UnableToParseException: X12 document ASCII or EBCDIC ISA header tag not found
-- Error message in Interchange 5.12.0:
java.util.IllegalFormatCodePointException: Code point = 0xffffffef
Resolution
Interchange does not support the usage of Byte Order Mark when it comes toparsing EDI X12 files.The corrective action is to ask the senderto remove the BOM before sending the EDI message.Alternatively an inline processor (custom code) could be used to remove the BOM and parse the file correctly.
** Interchange only supports single-byte character encodings for parsing the sender and receiver for EDI X12 messages. And multi-byte encoded character within the ISA header will break the parsing functionality.
** As per Unicode spec (http://www.unicode.org/versions/Unicode9.0.0/ch02.pdf) the use of BOM is not recommended:
Use of a BOM is neither required nor recommended for UTF-8, but may be encountered in contexts where UTF-8 data is converted from other encoding forms that use a BOM or where the BOM is used as a UTF-8 signature.