# HG changeset patch # User Goffi # Date 1458916363 -3600 # Node ID b603a3d516d30a699a55e84abb562d590c5a4129 # Parent 6a8b26754f0d446a224d8913f808914476f1bf89 jp (blog/edit): use utf-8-sig to decode content file to avoid BOM being propaged to content diff -r 6a8b26754f0d -r b603a3d516d3 frontends/src/jp/cmd_blog.py --- a/frontends/src/jp/cmd_blog.py Fri Mar 25 14:37:49 2016 +0100 +++ b/frontends/src/jp/cmd_blog.py Fri Mar 25 15:32:43 2016 +0100 @@ -330,7 +330,7 @@ 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 @@ 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