jp (blog/edit): use utf-8-sig to decode content file to avoid BOM being propaged to content
This commit is contained in:
parent
b6be98a193
commit
f600da971e
1 changed files with 2 additions and 2 deletions
|
|
@ -330,7 +330,7 @@ class Edit(base.CommandBase, BlogCommon):
|
|||
|
||||
else:
|
||||
# we can now send the blog
|
||||
mb_data['content_rich'] = content.decode('utf-8')
|
||||
mb_data['content_rich'] = content.decode('utf-8-sig') # we use utf-8-sig to avoid BOM
|
||||
|
||||
if item_ori_mb_data is not None:
|
||||
mb_data['id'] = item_ori_mb_data['id']
|
||||
|
|
@ -465,7 +465,7 @@ class Preview(base.CommandBase, BlogCommon):
|
|||
|
||||
def updateContent(self):
|
||||
with open(self.content_file_path, 'rb') as f:
|
||||
content = f.read().decode('utf-8')
|
||||
content = f.read().decode('utf-8-sig')
|
||||
if content and self.syntax != 'XHTML':
|
||||
# we use safe=True because we want to have a preview as close as possible to what the
|
||||
# people will see
|
||||
|
|
|
|||
Loading…
Reference in a new issue