mirror of
https://github.com/kovidgoyal/calibre.git
synced 2026-06-04 13:05:31 -04:00
Dont fail to recognize a UTF-8 encoded file even when the coding regexp has a spurious match
This commit is contained in:
@@ -118,7 +118,10 @@ def get_decoded_raw(name):
|
||||
try:
|
||||
raw = raw.decode(enc)
|
||||
except (LookupError, ValueError):
|
||||
pass
|
||||
try:
|
||||
raw = raw.decode('utf-8')
|
||||
except ValueError:
|
||||
pass
|
||||
return raw, syntax
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user