diff --git a/pelican/utils.py b/pelican/utils.py index cfbc3c23..e4ae8abd 100644 --- a/pelican/utils.py +++ b/pelican/utils.py @@ -184,11 +184,12 @@ def get_date(string): pass raise ValueError("'%s' is not a valid date" % string) - -def pelican_open(path): +def pelican_open(filename): """Open a file and return it's content""" - return open(path, encoding='utf-8').read() - + content = open(filename, encoding='utf-8').read() + if content[0] == codecs.BOM_UTF8.decode('utf8'): + content = content[1:] + return content def slugify(value): """