The UTF-8 BOM is a sequence of Bytes at the start of a text-stream (EF BB BF) that allows the reader to more reliably guess a file as being encoded in UTF-8.
(UTF-8 BOM是文本流(EF BB BF)开头的字节序列,它使读者可以更可靠地猜测文件是否已以UTF-8编码。)
Normally, the BOM is used to signal the endianness of an encoding, but since endianness is irrelevant to UTF-8, the BOM is unnecessary.
(通常,BOM用来表示编码的字节序,但是由于字节序与UTF-8不相关,因此不需要BOM。)
According to the Unicode standard , the BOM for UTF-8 files is not recommended :
(根据Unicode标准 , 不建议使用UTF-8文件的BOM :)
2.6 Encoding Schemes (2.6编码方案)
... 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.
(...对于UTF-8既不需要也不建议使用BOM,但是在从使用BOM的其他编码形式转换UTF-8数据或BOM用作UTF-8签名的情况下可能会遇到BOM。 。)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…