[英]What are those characters at the beginning of Visual Studio auto-generated files?
When Visual Studio generates, eg, a C# source file, if you edit it in an ASCII text editor, you'll see something that looks like the following character sequence: 当Visual Studio生成例如C#源文件时,如果在ASCII文本编辑器中编辑它,您将看到类似于以下字符序列的内容:
 一世”
Deleting these bytes doesn't seem to harm anything, but why are they put there in the first place? 删除这些字节似乎没有任何损害,但为什么它们首先放在那里?
This is a byte order marker (BOM). 这是一个字节顺序标记(BOM)。 It is used to indicate the encoding of the file.
它用于指示文件的编码。
More info: 更多信息:
That is the Unicode Byte-Ordering-Mark (BOM). 这就是Unicode Byte-Ordering-Mark(BOM)。 I believe Visual Studio by default creates files in the UTF-8 encoding with BOM.
我相信Visual Studio默认使用BOM创建UTF-8编码的文件。 If you treat the UTF-8 BOM as ASCII, it will display those characters.
如果将UTF-8 BOM视为ASCII,它将显示这些字符。 http://en.wikipedia.org/wiki/Byte-order_mark
http://en.wikipedia.org/wiki/Byte-order_mark
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.