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.
本文內容
延伸文章資訊
- 1The 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...
- 2BOM(字节顺序标记(ByteOrderMark))_百度百科
BOM —— Byte Order Mark,中文名译作“字节顺序标记”。在这里找到一段关于BOM 的说明:. 在UCS 编码中有一个叫做"Zero Width No-Break Space" ...
- 3Byte order mark - Wikipedia
The byte order mark (BOM) is a particular usage of the special Unicode character, U+FEFF BYTE ORD...
- 4UTF-8 BOM (Byte Order Mark) 的問題@新精讚
解釋為甚麼Windows 2000 以後的Notepad 存UTF-8 的檔案會加上BOM(Byte Order Mark, U+FEFF), 主要是因為UTF-8 和ASCII 是相容的, 為...
- 5這些是什麼? BOM/UFT-8有簽章/withBOM/withoutBOM - iT 邦幫忙
這是另一篇關於BOM之亂的描述. Windows 作業系統不少程式(像是記事本),預設會對UTF-8 檔案加上BOM 而Linux 則避免 ...