UnicodeDecodeError: 'charmap' codec can't decode byte X in position Y: character maps to

前端 未结 9 1528
情歌与酒
情歌与酒 2020-11-22 00:43

I\'m trying to get a Python 3 program to do some manipulations with a text file filled with information. However, when trying to read the file I get the following error:

9条回答
  •  长情又很酷
    2020-11-22 00:59

    For those working in Anaconda in Windows, I had the same problem. Notepad++ help me to solve it.

    Open the file in Notepad++. In the bottom right it will tell you the current file encoding. In the top menu, next to "View" locate "Encoding". In "Encoding" go to "character sets" and there with patiente look for the enconding that you need. In my case the encoding "Windows-1252" was found under "Western European"

提交回复
热议问题