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,6 +118,9 @@ def get_decoded_raw(name):
try: try:
raw = raw.decode(enc) raw = raw.decode(enc)
except (LookupError, ValueError): except (LookupError, ValueError):
try:
raw = raw.decode('utf-8')
except ValueError:
pass pass
return raw, syntax return raw, syntax