mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
import BOM_UTF8
This commit is contained in:
parent
e94147cd3a
commit
c3baf93445
1 changed files with 2 additions and 2 deletions
|
|
@ -14,7 +14,7 @@ import fnmatch
|
|||
from collections import defaultdict, Hashable
|
||||
from functools import partial
|
||||
|
||||
from codecs import open
|
||||
from codecs import open, BOM_UTF8
|
||||
from datetime import datetime
|
||||
from itertools import groupby
|
||||
from jinja2 import Markup
|
||||
|
|
@ -187,7 +187,7 @@ def get_date(string):
|
|||
def pelican_open(filename):
|
||||
"""Open a file and return it's content"""
|
||||
content = open(filename, encoding='utf-8').read()
|
||||
if content[0] == codecs.BOM_UTF8.decode('utf8'):
|
||||
if content[0] == BOM_UTF8.decode('utf8'):
|
||||
content = content[1:]
|
||||
return content
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue