Which crashes the program when reading a text file?

When reading out the trace file. Below shows the error and the code that opens the file.
Error:
5b557c3939a26492087320.png
Code:
filenames = ['peter.txt', 'walkin_essays.txt']

for filename in filenames:
 with open(filename) as file_object:
 content = file_object.read()
 print(content.count('the'))

The translation type of the error:
UnicodeDecodeError: 'charmap' codec can't decode byte 0x98 in position 3589: character maps to :
codec "charmap" can't decode byte 0x98 in position 3589: character mapping <not determined>
Text files contain books, duck their volume is not small.

Maybe someone knows what this is?
June 3rd 19 at 18:58
1 answer
June 3rd 19 at 19:00
Solution
encoding files other or even different
with open(filename, encoding = 'utf8') try
Thank you very much, THANK you very much!!!!!!!!" - baby_Bergnaum commented on June 3rd 19 at 19:03

Find more questions by tags Text editorsPythonSublime Text