When I use Visual Studio (2008 and 2010) to create a new text or XML file, it always includes three strange-looking bytes at the very beginning of the file. These three bytes can't be seen unless you are using a binary editor.
Why are they there and what do they do?
Is there a way to stop Visual Studio from putting them there?
As it stands I cannot use Visual Studio to create XML files because these bytes screw up the parser.
it's BOM or Byte Order Mark this usually happens when you save your file using other encoding especially in UTF-8 to solve it...
open File menu > select Advanced Save Options > then select UTF-8 without signature
This is a utf8 byte order mark
see here for more information. It basically states that its a text file in utf8 format. Most text editors recognise it and therefore know how to understand the format of the file.
Is your XML parser hand rolled? All production grade XML parsers I've used have no problem (infact are positively helped) by having a correct BOM.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With