UnicodeDecodeError: 'charmap' codec can't decode byte 0x90 in position 100: character maps to <undefined>

Viewed 8550
3 Answers

To read any binary file/db use the encoding="utf-8" while opening the file/db. UTF-8 is capable of encoding all 1,112,064 valid character code points in Unicode using one to four one-byte code units. So, simple is the best.

To read the above binary file, use

ent = open(ent, 'rb')

instead of,

ent = open(ent)

Try encoding it.

with open(file, encoding="utf-8") as file:
    # Reads each character
    file.read()
Related