Avatar ·

Python: 'Charmap' Codec Can't Decode Byte 0x98

📁 iterator, Advanced Python Topics, Error, example, work

Good afternoon. I read a UTF8 file and display it to the console. When trying to output the letters "" and "" an error occurs:

file "I:\\programfile\\anaconda\\lib\\encodings\\cp1251.py", line 15, in decode
return codecs.charmap_decode(input, errors, decoding_table)
UnicodeDecodeError: 'charmap' codec can't decode byte 0x98 in position 1: character maps to <undefined>

It reproduces on this example:

test_text_1 = "Task"