本文介绍了UTF-8和不带BOM的UTF-8有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
没有 BOM 的UTF-8和UTF-8有什么区别?哪个更好?
What's different between UTF-8 and UTF-8 without a BOM? Which is better?
推荐答案
UTF-8 BOM是文本流(0xEF, 0xBB, 0xBF
)开头的一系列 bytes ,允许读者以更可靠地猜测文件是否已以UTF-8编码.
The UTF-8 BOM is a sequence of bytes at the start of a text stream (0xEF, 0xBB, 0xBF
) that allows the reader to more reliably guess a file as being encoded in UTF-8.
通常, BOM 用于表示字节序,但是由于字节序与UTF-8不相关,因此不需要BOM.
Normally, the BOM is used to signal the endianness of an encoding, but since endianness is irrelevant to UTF-8, the BOM is unnecessary.
根据 Unicode标准,不建议使用UTF-8文件:
According to the Unicode standard, the BOM for UTF-8 files is not recommended:
这篇关于UTF-8和不带BOM的UTF-8有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!