Enum unicode_bom::Bom
source · pub enum Bom {
Null,
Bocu1,
Gb18030,
Scsu,
UtfEbcdic,
Utf1,
Utf7,
Utf8,
Utf16Be,
Utf16Le,
Utf32Be,
Utf32Le,
}
Expand description
Unicode byte-order mark (BOM) abstraction.
Variants§
Null
Indicates no BOM was detected.
Bocu1
Indicates BOCU-1 BOM was detected.
Gb18030
Indicates GB 18030 BOM was detected.
Scsu
Indicates SCSU BOM was detected.
UtfEbcdic
Indicates UTF-EBCIDC BOM was detected.
Utf1
Indicates UTF-1 BOM was detected.
Utf7
Indicates UTF-7 BOM was detected.
Utf8
Indicates UTF-8 BOM was detected.
Utf16Be
Indicates UTF-16 (big-endian) BOM was detected.
Utf16Le
Indicates UTF-16 (little-endian) BOM was detected.
Utf32Be
Indicates UTF-32 (big-endian) BOM was detected.
Utf32Le
Indicates UTF-32 (little-endian) BOM was detected.
Implementations§
Trait Implementations§
source§impl AsRef<[u8]> for Bom
impl AsRef<[u8]> for Bom
source§fn as_ref(&self) -> &[u8] ⓘ
fn as_ref(&self) -> &[u8] ⓘ
Returns the BOM byte-array literal.
Note that for UTF-7,
only the first three bytes of the BOM are returned.
That’s because the last two bits of the fourth byte
belong to the following character,
so it’s impossible to return the fourth byte
without further context.
Possible values for the missing fourth byte
are 0x38
, 0x39
, 0x2a
and 0x2b
.