UnicodeDecodeError:'charmap'编解码器无法解码位置Y中的字节X:字符映射到<未定义>
2022-09-05 01:19:13
我试图让一个Python 3程序对一个充满信息的文本文件进行一些操作。但是,尝试读取文件时,我收到以下错误:
Traceback (most recent call last):
File "SCRIPT LOCATION", line NUMBER, in <module>
text = file.read()`
File "C:\Python31\lib\encodings\cp1252.py", line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x90 in position 2907500: character maps to `<undefined>`