Avatar ·

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

📁 Iterator in Python: Grundlagen und Anwendung, Python, Fehler, Beispiel, Arbeit

Guten Tag, ich lese eine UTF8-Datei und gebe sie auf der Konsole aus. Beim Versuch, das Zeichen "" und "" abzuleiten, tritt ein Fehler auf:

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 at position 1: character maps to <undefined>

Es wird an diesem Beispiel getestet:

test_text_1 = "Task"