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:
As an extension to @LennartRegebro's answer:
If you can't tell what encoding your file uses and the solution above does not work (it's not utf8
) and you found yourself merely guessing - there are online tools that you could use to identify what encoding that is. They aren't perfect but usually work just fine. After you figure out the encoding you should be able to use solution above.
EDIT: (Copied from comment)
A quite popular text editor Sublime Text
has a command to display encoding if it has been set...
View
-> Show Console
(or Ctrl+`)
view.encoding()
and hope for the best (I was unable to get anything but Undefined
but maybe you will have better luck...)