BOM是什么意思? [英] what is meant by BOM?

查看:169
本文介绍了BOM是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

BOM 是什么意思?我尝试阅读本文,但并没有真正理解它的含义.

What is meant by BOM ? I tried reading this article but haven't really understood what does it mean.

我读到一些文本编辑器将BOM放在文件开头之前.这是什么意思?

I read that some text editors put BOM before the beginning of a file. What it is meant for ?

推荐答案

BOM 表示字节顺序标记.简而言之, BOM 是文件开头的标记,用于指示是应该将最高有效字节还是最低有效字节排在首位.

BOM stands for Byte Order Mark. In short, the BOM is marker at the beginning of a file to indicate if the most significant byte, or the least significant byte should come first.

它会引起很多问题,尤其是对于UTF8.UTF8不使用BOM,但是有一个称为UTF8Y(或带有BOM的UTF)的变体,在文件的开头包含一些额外的字符.

It causes a lot of problems, especially with UTF8. UTF8 does not use a BOM, but there is a variant called UTF8Y (Or UTF with BOM) that includes a few extra characters at the beginning of a file.

发送具有UTF8编码类型的UTF8Y文件会导致在文件的开头发送一些额外的字节,并且可能导致各种难以追踪的问题,包括未正确解析IE的DOCTYPE或JSON文件无法解码.

Sending a UTF8Y file, with a UTF8 encoding type, causes a few extra bytes to be sent at the beginning of the file and can cause all sorts of hard-to-track down problems including the DOCTYPE not being parsed correctly one IE or JSON files to fail to be decoded.

当我不仔细检查文件类型时,它被其他人的文件咬了好几次.

It has bitten me a few times with files from other people, when I didn't check the filetype carefully.

我的建议:请记住它的存在,切勿有目的地使用它.

My recommendation: Be mindful it exists, never purposefully use it.

这篇关于BOM是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆