sintaxi/terraform — pull request #34 by wpyz (2014-01-30 15:41:11+00:00)
Title: Render markdown files encoded in UTF-8 with BOM

Came across an issue with Harp when testing where the first line of a markdown file was not being parsed correctly.

Turns out that Visual Studio 2013 saves UTF-8 files with a BOM marker by default. Buffer.toString() returns a string with the BOM marker in it, which in turn breaks marked. BOM markers in UTF-8 encoded files are redundant, so it is safe to strip them.

I'm not entirely sure whether Git preserves file encodings (suspect they don't), so to make sure the tests are testing for the right thing, ensure that tests/fixtures/templates/bom.md is saved encoded as UTF-8 with BOM. This can be achieved with the following:

* __Notepad++__: Encoding -> Encode in UTF-8
* __Sublime Text__: File -> Save With Encoding -> UTF-8 with BOM
* __Visual Studio__: File -> Advanced Save Options -> Encoding = Unicode (UTF-8 with signature) - Codepage 65001

See [the Wikipedia page](http://en.wikipedia.org/wiki/UTF-8#Byte_order_mark) more information.