Description: When generating an outbound X12 document using UTF-8 encoding, extra characters are placed at the beginning of the file. Can this behavior be suppressed? Also, when receiving X12 documents with UTF-8, BC does not process the UTF-8 characters correctly, substituting garbage characters instead. How can this be corrected?
Symptoms: For outbound documents, the beginning of the generated X12 file has the following hex values:
EF BB BF (or similar)
before the ISA segment.
For inbound documents, no such string is present.
Cause: For UTF-8 character generation and processing, a BOM (Byte Order Mark) is required. For outbound documents, BC inserts a BOM (Byte Order Mark). Because UTF-8 is a multibyte character set, a BOM field is needed to tell the receiving application in what order the multibyte characters occur. For an inbound document, a BOM is required on the inbound document to tell the Instream parser how to process the inbound document.