UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe0 in position 16: invalid continuation byte
#!/usr/bin/env python
# -*- coding:utf-8 -*-
with open(file_name, 'r', encoding='utf-8') as data:
for line in data.readlines():
print(line)
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import codecs
with open(file_name, 'r', encoding='utf-8', errors='replace') as data:
for line in data.readlines():
print(line)
My UnicodeDecodeError are gone after manually doing the above.
https://github.com/SublimeText/CTags/issues/194
https://docs.python.org/2/library/codecs.html#codec-base-classes