UnicodeDecodeError: ‘charmap’ codec can’t decode byte 0x9d in position 340: character maps to

file = open(filename, encoding="utf8")

Here is what the above code is Doing:
1. We’re opening the file in read mode.
2. We’re using the utf8 encoding.
3. We’re storing the file in the variable “file”.