chucknorris/warmup — Issue #8: Including the Byte Order Mark (BOM)/Preamble for yml files breaks Ruby yml parsing
Author: amirrajan
Created: 2012-02-07 02:17:49+00:00
State: open

TL;DR:
Only add the UTF8 BOM/Preamble to .sln files.

If you WarmuP a template that contains a .yml file, this line adds the Byte Order Mark/Preamble for UTF8: https://github.com/chucknorris/warmup/blob/master/warmup/TargetDir.cs#L82

The WriteAllText method that is currently being used writes the BOM as the first byte in the file.

Ruby's core yml library reads the BOM as part of the key (the yml is read..but the hash created contains the BOM...not so great...rails applications uses config.yml...it breaks stuff to say the least...)

Also, based on this StackOverflow answer, it is apparently not a good thing to add the BOM to xml files:
http://stackoverflow.com/questions/1317700/strip-byte-order-mark-from-string-in-c-sharp

The BOM is unfortunately required for .sln files so that VSSelector can open the solution and not crash.