What's the difference between UTF-8 and UTF-8

2018-12-31 01:21发布

What's different between UTF-8 and UTF-8 without a BOM? Which is better?

20条回答
与风俱净
2楼-- · 2018-12-31 01:58

UTF with BOM is better if you use UTF-8 in HTML files, if you use Serbian Cyrillic, Serbian Latin, German, Hungarian or something exotic language in the same page. That is my opinion (30 years of computing and IT industry).

查看更多
笑指拈花
3楼-- · 2018-12-31 01:59

UTF-8 without BOM has no BOM, which doesn't make it any better than UTF-8 with BOM, except when the consumer of the file needs to know (or would benefit from knowing) whether the file is UTF-8-encoded or not.

The BOM is usually useful to determine the endianness of the encoding, which is not required for most use cases.

Also, the BOM can be unnecessary noise/pain for those consumers that don't know or care about it, and can result in user confusion.

查看更多
登录 后发表回答