Byte order mark

From Wikipedia, the free encyclopedia
Jump to: navigation, search

Byte order mark is an abstract character used to declare and recognize Unicode encoding of a text file. It is encoded as Unicode character U+FEFF byte order mark (BOM).

BOM use is optional, and, if used, should appear at the start of the text stream. The BOM gives the producer of the text a way to describe the text stream's endianness, and so its encoding such as UTF-8, or UTF-16.

The need for a BOM arises in the context of text interchange, rather than in normal text processing within a closed environment.

A leading BOM can defeat some legacy software, including Unix shebang, PHP and Java.

A BOM is commonly inserted by many software tools including Notepad and Visual C++,or Google Docs.