mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
py3 compat: Fix diff on non HTML files not working
This commit is contained in:
parent
a6840fb462
commit
78e967edc6
@ -118,6 +118,8 @@ def get_decoded_raw(name):
|
|||||||
enc = 'utf-8'
|
enc = 'utf-8'
|
||||||
else:
|
else:
|
||||||
enc = force_encoding(raw, verbose=True)
|
enc = force_encoding(raw, verbose=True)
|
||||||
|
if isinstance(enc, bytes):
|
||||||
|
enc = enc.decode('utf-8', 'ignore')
|
||||||
try:
|
try:
|
||||||
raw = raw.decode(enc)
|
raw = raw.decode(enc)
|
||||||
except (LookupError, ValueError):
|
except (LookupError, ValueError):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user