diff --git a/frontends/src/jp/cmd_blog.py b/frontends/src/jp/cmd_blog.py index 47e3f9a3..0fedf5c5 100644 --- a/frontends/src/jp/cmd_blog.py +++ b/frontends/src/jp/cmd_blog.py @@ -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