mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -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:
parent
e5cdc8f347
commit
a837768348
@ -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
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user