What are these characters at the beginning of the files created in Visual Studio?

When Visual Studio generates, for example, a C # source file, if you edit it in an ASCII text editor, you will see something similar to the following sequence of characters:

ï "¿

Removing those bytes doesn't hurt anything, but why are they being put there in the first place?

+2


source to share


2 answers


It is a Byte Order Marker (BOM). It is used to indicate the encoding of the file.

Additional Information:



+6


source


This is a Unicode Byte-Order Mark (BOM). I believe Visual Studio creates UTF-8 encoded files by default using a BOM. If you treat the UTF-8 BOM as ASCII, it displays those characters. http://en.wikipedia.org/wiki/Byte-order_mark



+3


source







All Articles