Byte order mark - Globalization - Microsoft Learn
文章推薦指數: 80 %
Byte Order Mark (BOM) is used to indicate how a processor places serialized text into a sequence of bytes.
跳到主要內容
已不再支援此瀏覽器。
請升級至MicrosoftEdge,以利用最新功能、安全性更新和技術支援。
下載MicrosoftEdge
InternetExplorer和MicrosoftEdge的詳細資訊
目錄
結束焦點模式
閱讀英文
儲存
目錄
閱讀英文
儲存
編輯
列印
Twitter
LinkedIn
Facebook
電子郵件
目錄
Byteordermark
發行項
01/31/2022
閱讀時間2分鐘
3位參與者
本文內容
AnotherconcepttobefamiliarwithasyouworkwithUnicodeisthatofbyte-ordermark(BOM).
ABOMisusedtoindicatehowaprocessorplacesserializedtextintoasequenceofbytes.
Iftheleastsignificantbyteisplacedintheinitialposition,thisisreferredtoas"little-endian,"whereasifthemostsignificantbyteisplacedintheinitialposition,themethodisknownas"big-endian."
ABOMcanalsobeusedasafilesignaturetoidentifytheencodingofatextfile,inadditiontothebyteorder.
Notepad,forexample,mayaddafilesignaturetothebeginningofeachfile,dependingontheencodingusedinsavingthefile.
ThissignatureallowsNotepadtoreopenthefilelaterwiththecorrectinterpretationofthebytesasUnicode,versussomeunknown,implicit,andambiguouscodepage.
Table1showsthebyte-ordermarksforvariousencodings.
TheUTF-8filesignature(commonlyalsocalleda"BOM")identifiestheencodingformatratherthanthebyteorderofthedocument.
UTF-8isalinearsequenceofbytesandnotsequenceof2-byteor4-byteunitswherethebyteorderisimportant.
Encoding
EncodedBOM
UTF-8
EFBBBF
UTF-16big-endian
FEFF
UTF-16little-endian
FFFE
UTF-32big-endian
0000FEFF
UTF-32little-endian
FFFE0000
Table1:Binaryrepresentationofthebyte-ordermark(U+FEFF)forspecificencodings.
本文內容
延伸文章資訊
- 1位元組順序記號 - 维基百科
位元組順序記號(英語:byte-order mark,BOM)是位於碼點 U+FEFF 的統一碼字符的名称。當以UTF-16或UTF-32來將UCS/統一碼字符所組成的字串編碼時,這個字符被用來...
- 2The byte-order mark (BOM) in HTML - W3C
Each 2-digit hexadecimal number represents a byte in the stream of text. You can see that the ord...
- 3Byte order mark - Wikipedia
The byte order mark (BOM) is a particular usage of the special Unicode character, U+FEFF BYTE ORD...
- 4這些是什麼? BOM/UFT-8有簽章/withBOM/withoutBOM - iT 邦幫忙
這是另一篇關於BOM之亂的描述. Windows 作業系統不少程式(像是記事本),預設會對UTF-8 檔案加上BOM 而Linux 則避免 ...
- 5What is a Byte Order Mark (BOM)? - Definition from Techopedia
The byte order mark (BOM) is a piece of information used to signify that a text file employs Unic...