BOM – Byte Order Mark in BizTalk output

December 13th, 2006

Today was another day of new BizTalk problems … The task was easy; produce a XML file and send to a receiving system. Fine. Done. … Not.

The receiving system could not read the file because of some strange characters in the beginning of the file! It looked something like the below when opening the file in a fancy text editor (UltraEdit or TextPad for example).

<?xml version="1.0" encoding="utf-8"?>

After a couple of very interesting (:/) hours of Googling I found this from Ben McFarlin

It is because internal BizTalk messages are in UTF8 format and include
the byte order mark. When you added the xml declaration for UTF16 it
confused the engine; the declaration read UTF16 but the byte order mark indicated UTF8.

Preserve BOMWhen I finally found the cause the solution was easy. Just another of those weird properties …    This time it’s called Preserve BOM (on the properties of the XML Assembly pipeline component – see figure on the right). BOM of course stands for Byte Order Mark.

Leave a Reply