mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Remove BOM mark from litres plugin and also handle BOM mark when downloading plugins
This commit is contained in:
parent
ba12709d65
commit
959acc1f28
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user