Byte order mark - Globalization - Microsoft Learn

文章推薦指數: 80 %
投票人數:10人

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. 本文內容



請為這篇文章評分?