Dont fail to recognize a UTF-8 encoded file even when the coding regexp has a spurious match

This commit is contained in:
Kovid Goyal 2015-07-22 14:09:26 +05:30
parent e5cdc8f347
commit a837768348

View File

@ -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