As suggested by Mark Ransom, I found the right encoding for that problem. The encoding was "ISO-8859-1"
, so replacing open("u.item", encoding="utf-8")
with open('u.item', encoding = "ISO-8859-1")
will solve the problem.
More Related Contents:
- Best way to convert string to bytes in Python 3?
- The smtplib.server.sendmail function in python raises UnicodeEncodeError: ‘ascii’ codec can’t encode character
- python 3 open() default encoding
- What encoding does open() use by default?
- a pythonic way of doubling consecutive binary bits [closed]
- How to display position of an element in an array? [closed]
- User input integer list [duplicate]
- How to make Firefox headless programmatically in Selenium with Python?
- Why is Python 3.x’s super() magic?
- NameError: global name ‘unicode’ is not defined – in Python 3
- Installing scipy in Python 3.5 on 32-bit Windows 7 Machine
- How to run pip from different versions of python using the python command?
- Schedule a repeating event in Python 3
- How to melt 2 columns at the same time?
- i am sending commands through serial port in python but they are sent multiple times instead of one
- Why is there no xrange function in Python3?
- Get all keys of a nested dictionary [duplicate]
- Type hints when unpacking a tuple?
- Sorting by absolute value without changing to absolute value
- Why isn’t .ico file defined when setting window’s icon?
- How to capitalize the first letter of every sentence?
- Printing result of the zip() function in Python 3 gives “zip object at ” [duplicate]
- FutureWarning: The default value of regex will change from True to False in a future version
- Multiple keys per value
- Is there a way to get a line number from an ElementTree Element
- Python: can’t assign to literal
- Python making combined bar and line plot with secondary y-axis
- Why do I get “TypeError: not all arguments converted during string formatting” trying to substitute a placeholder like {0} using %?
- What are assignment expressions (using the “walrus” or “:=” operator)? Why was this syntax added?
- TypeError: cannot unpack non-iterable NoneType object