e01.org

Byte order mark

The byte order mark (BOM) is a particular usage of the special Unicode character code, , whose appearance as a magic number at the start of a text stream can signal several things to a program reading the text: * the byte order, or endianness, of the text stream in the cases of 16-bit and 32-bit encodings; * the fact that the text stream's encoding is Unicode, to a high level of confidence; * which Unicode character encoding is used. BOM use is optional. Its presence interferes with the use of UTF-8 by software that does not expect non-ASCII bytes at the start of a file but that could otherwise handle the text stream. Unicode can be encoded in units of 8-bit, 16-bit, or 32-bit integers. For... Source: e01 Encyclopedia. Licence: CC BY-SA 4.0.

The byte order mark (BOM) is a particular usage of the special Unicode character code, , whose appearance as a magic number at the start of a text stream can signal several things to a program reading the text: the byte order, or endianness, of the text stream in the cases of 16-bit and 32-bit encodings; the fact that the text stream's encoding is Unicode, to a high level of confidence; which Unicode character encoding is used. BOM use is optional. Its presence interferes with the use of UTF-8 by software that does not expect non-ASCII bytes at the start of a file but that could otherwise handle the text stream. Unicode can be encoded in units of 8-bit, 16-bit, or 32-bit integers. For 16- and 32-bit representations, a computer receiving text from arbitrary sources needs to know which byte order the integers are encoded in. The BOM becomes a Unicode code point if its bytes are swapped. Hence, the process accessing the text can examine these first few bytes to determine the endianness, without requiring some contract or metadata outside of the text stream itself. Generally the receiving computer will swap the bytes to its own endianness, if necessary, and would no longer need the BOM for processing. The byte sequence of the BOM differs per Unicode encoding (including UTF-8 and ones outside the Unicode standard such as UTF-7, see table below), and none of the sequences is likely to appear at the start of text streams stored in other encodings. Therefore, placing an encoded BOM at the start of a text stream can indicate that the text is Unicode and identify the encoding scheme used. This use of the BOM is called a "Unicode signature".

References

  1. ^ Gerhards, Rainer (March 2009). "MSG" . The Syslog Protocol . IETF . sec. 6.4. doi : 10.17487/RFC5424 . RFC 5424 . Wikipedia revision 1377262082, retrieved 2026-11-21 · 1795215600.0
  2. ^ Alf P. Steinbach (2011). "Unicode part 1: Windows console i/o approaches" . Archived from the original on 22 March 2012 . Retrieved 24 March 2012 . However, since the C++ source code was encoded as UTF-8 without BOM (as is usual in Linux), the Visual C++ compiler erroneously assumed that the source code was encoded as Windows ANSI. Wikipedia revision 1377262082, retrieved 2026-11-21 · 1795215600.0
  3. ^ "Windows 10 Notepad is Getting Better UTF-8 Encoding Support" . BleepingComputer . Archived from the original on 7 March 2023 . Retrieved 7 March 2023 . Wikipedia revision 1377262082, retrieved 2026-11-21 · 1795215600.0
  4. ^ "UTF-16LE" . Encoding Standard . WHATWG. Archived from the original on 4 February 2015 . Retrieved 20 September 2017 . Wikipedia revision 1377262082, retrieved 2026-11-21 · 1795215600.0
  5. ^ "Decode" . Encoding Standard . WHATWG. Archived from the original on 4 February 2015 . Retrieved 20 September 2017 . Wikipedia revision 1377262082, retrieved 2026-11-21 · 1795215600.0
  6. ^ Yergeau, François (8 November 2003). "RFC 3629 - UTF-8, a transformation format of ISO 10646" . Ietf Datatracker . Archived from the original on 11 August 2015 . Retrieved 28 January 2017 . Wikipedia revision 1377262082, retrieved 2026-11-21 · 1795215600.0
  7. ^ Followed by 38 , 39 , 2B , or 2F (ASCII 8 , 9 , + or / ), depending on what the next character is. Wikipedia revision 1377262082, retrieved 2026-11-21 · 1795215600.0
  8. ^ Honermann, Tom (2 January 2021). "Clarify guidance for use of a BOM as a UTF-8 encoding signature" (PDF) . Unicode . Archived (PDF) from the original on 19 August 2021 . Retrieved 16 May 2021 . Wikipedia revision 1377262082, retrieved 2026-11-21 · 1795215600.0
  9. ^ "SDL Documentation" . Archived from the original on 16 May 2021 . Retrieved 16 May 2021 . Wikipedia revision 1377262082, retrieved 2026-11-21 · 1795215600.0
  10. ^ "Carta com ajustes" . doi.org . Retrieved 17 June 2026 . Wikipedia revision 1377262082, retrieved 2026-11-21 · 1795215600.0
  11. ^ Markus Scherer. "UTS #6: Compression Scheme for Unicode" . Unicode.org . Archived from the original on 20 January 2022 . Retrieved 28 January 2017 . Wikipedia revision 1377262082, retrieved 2026-11-21 · 1795215600.0
  12. ^ SCSU allows other encodings of U+FEFF, the shown form is the signature recommended in UTR #6. [ 18 ] Wikipedia revision 1377262082, retrieved 2026-11-21 · 1795215600.0
  13. ^ "The Unicode Standard 5.0, Chapter 2:General Structure" (PDF) . p. 36. Archived (PDF) from the original on 22 April 2021 . Retrieved 29 March 2009 . Table 2-4. The Seven Unicode Encoding Schemes Wikipedia revision 1377262082, retrieved 2026-11-21 · 1795215600.0
  14. ^ "The Unicode Standard 5.0, Chapter 2:General Structure" (PDF) . p. 36. Archived (PDF) from the original on 22 April 2021 . Retrieved 30 November 2008 . 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 Wikipedia revision 1377262082, retrieved 2026-11-21 · 1795215600.0
  15. ^ "Re: pre-HTML5 and the BOM from Asmus Freytag on 2012-07-13 (Unicode Mail List Archive)" . Unicode.org . Archived from the original on 16 June 2019 . Retrieved 14 July 2012 . Wikipedia revision 1377262082, retrieved 2026-11-21 · 1795215600.0
  16. ^ "Bug ID: JDK-6378911 UTF-8 decoder handling of byte-order mark has changed" . Bugs.java.com . Archived from the original on 29 June 2021 . Retrieved 14 October 2021 . Wikipedia revision 1377262082, retrieved 2026-11-21 · 1795215600.0
  17. ^ a b c d e f g This is not literally a "byte order" mark, since a code unit in these encodings is one byte and therefore cannot have bytes in a "wrong" order. Nevertheless, the BOM can be used to indicate the encoding of the text that follows it. [ 6 ] [ 15 ] Wikipedia revision 1377262082, retrieved 2026-11-21 · 1795215600.0
  18. ^ "Zero Width No-Break Space (U+Feff)" . Archived from the original on 13 May 2023 . Retrieved 13 May 2023 . Wikipedia revision 1377262082, retrieved 2026-11-21 · 1795215600.0
  19. ^ Yergeau, Francois (November 2003). UTF-8, a transformation format of ISO 10646 . IETF . doi : 10.17487/RFC3629 . RFC 3629 . Retrieved 15 May 2014 . Wikipedia revision 1377262082, retrieved 2026-11-21 · 1795215600.0
  20. ^ a b "FAQ - UTF-8, UTF-16, UTF-32 & BOM" . Unicode.org . Archived from the original on 2 May 2021 . Retrieved 28 January 2017 . Wikipedia revision 1377262082, retrieved 2026-11-21 · 1795215600.0
  21. ^ a b "FAQ - UTF-8, UTF-16, UTF-32 & BOM: Can a UTF-8 data stream contain the BOM character (in UTF-8 form)? If yes, then can I still assume the remaining UTF-8 bytes are in big-endian order?" . Unicode.org . Retrieved 4 January 2009 . Wikipedia revision 1377262082, retrieved 2026-11-21 · 1795215600.0
  22. FAQ - UTF-8, UTF-16, UTF-32 & BOM . Unicode.org . retrieved 28 January 2017 · 1790550000.0
  23. UTF-16LE . Encoding Standard . retrieved 20 September 2017 · 1790550000.0
  24. Decode . Encoding Standard . retrieved 20 September 2017 · 1790550000.0
  25. RFC 3629 - UTF-8, a transformation format of ISO 10646 . Ietf Datatracker . 8 November 2003. retrieved 28 Januar · 1790550000.0
  26. Clarify guidance for use of a BOM as a UTF-8 encoding signature . · 1790550000.0
  27. SDL Documentation . · 1790550000.0
  28. tt|F7 64 4C | tt|247 100 76 | tt|÷dL |- | UTF-EBCDIC | tt|DD 73 66 73 | tt|221 115 102 115 | tt|Ýsfs |- | Standard Compression Scheme for Unicode|SCSU | tt|0E FE FF . · 1790550000.0
  29. Carta com ajustes . doi.org . retrieved 2026-06-17 · 1781650800.0
  30. Zero Width No-Break Space (U+Feff) . retrieved 13 May 2023 · 1790550000.0
  31. The Unicode Standard 5.0, Chapter 2:General Structure . retrieved 29 March 2009 · 1790550000.0
  32. FAQ - UTF-8, UTF-16, UTF-32 & BOM: Can a UTF-8 data stream contain the BOM character (in UTF-8 form)? If yes, then can I still assume the remaining UTF-8 bytes are in big-endian ord . · 1790550000.0
  33. Re: pre-HTML5 and the BOM from Asmus Freytag on 2012-07-13 (Unicode Mail List Archive) . Unicode.org . · 1790550000.0
  34. Bug ID: JDK-6378911 UTF-8 decoder handling of byte-order mark has changed . Bugs.java.com . retrieved 14 Oct · 1790550000.0
  35. Alf P. Steinbach. Unicode part 1: Windows console i/o approaches . retrieved 24 March 20 · 1790550000.0
  36. Windows 10 Notepad is Getting Better UTF-8 Encoding Support . · 1790550000.0
source: e01 Encyclopedia · licence: CC BY-SA 4.0 · page · source revision

Cite this

"Byte order mark". 1790603273. e01 Encyclopedia. CC BY-SA 4.0. https://en.wikipedia.org/w/index.php?oldid=1377262082

JSON record · API collection · BibTeX · RIS · CSL-JSON · citation policy

Save to pass ·