Remove BOM mark from litres plugin and also handle BOM mark when downloading plugins

This commit is contained in:
Kovid Goyal 2015-02-08 15:22:31 +05:30
parent ba12709d65
commit 959acc1f28
2 changed files with 2 additions and 2 deletions

View File

@ -37,7 +37,7 @@ def download_updates(ver_map={}, server='https://code.calibre-ebook.com'):
name = name.decode('utf-8')
d = decompressobj()
src = d.decompress(raw)
src = src.decode('utf-8')
src = src.decode('utf-8').lstrip(u'\ufeff')
# Python complains if there is a coding declaration in a unicode string
src = re.sub(r'^#.*coding\s*[:=]\s*([-\w.]+)', '#', src, flags=re.MULTILINE)
# Translate newlines to \n

View File

@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
from __future__ import (unicode_literals, division, absolute_import, print_function)
store_version = 1 # Needed for dynamic plugin loading