开发者

What are those characters at the beginning of Visual Studio auto-generated files?

When Visual Studio generates, e.g., a C# source file, if you edit it in an ASCII text editor, you'll see something that looks like the following character sequence:开发者_C百科



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). It is used to indicate the encoding of the file.

More info:

  • http://en.wikipedia.org/wiki/Byte-order_mark


That is the Unicode Byte-Ordering-Mark (BOM). I believe Visual Studio by default creates files in the UTF-8 encoding with BOM. If you treat the UTF-8 BOM as ASCII, it will display those characters. http://en.wikipedia.org/wiki/Byte-order_mark

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜