Remove BOM from Markdown files if needed (ref #86).

This commit is contained in:
Simon Conseil
2014-04-09 22:52:40 +02:00
parent ccc4b44e72
commit 71626dd234

View File

@@ -240,7 +240,8 @@ class Album(UnicodeMixin):
descfile = join(self.src_path, self.description_file)
if isfile(descfile):
with codecs.open(descfile, "r", "utf-8") as f:
# Use utf-8-sig codec to remove BOM if it is present
with codecs.open(descfile, 'r', 'utf-8-sig') as f:
text = f.read()
md = markdown.Markdown(extensions=['meta'])