utf-8 codec can't decode byte python code example
Example 1: 'charmap' codec can't decode byte 0x98 in position
file = open(filename, encoding="utf8")
Example 2: UnicodeDecodeError: 'utf-8' codec can't decode byte invalid start byte
# Use 'ISO-8859-1' instead of "utf-8" for decoding
text = open(fn, 'rb').read().decode('ISO-8859-1')