close

[Fixed] UnicodeDecodeError: ‘utf8’ codec can’t decode byte 0xe9 in position 10: invalid continuation byte

Today We are Going To Solve UnicodeDecodeError: ‘utf8’ codec can’t decode byte 0xe9 in position 10: invalid continuation byte in Python. Here we will Discuss All Possible Solutions and How this error Occurs So let’s get started with this Article.

How to Fix UnicodeDecodeError: ‘utf8’ codec can’t decode byte 0xe9 in position 10: invalid continuation byte Error?

  1. How to Fix UnicodeDecodeError: 'utf8' codec can't decode byte 0xe9 in position 10: invalid continuation byte Error?

    To Fix UnicodeDecodeError: 'utf8' codec can't decode byte 0xe9 in position 10: invalid continuation byte Error just Change the encoding to latin-1. Here you have to change the encoding to latin-1. You can see this in below command. pd.read_csv('ml-100k/u.item', sep='|', names=m_cols , encoding='latin-1')

  2. UnicodeDecodeError: 'utf8' codec can't decode byte 0xe9 in position 10: invalid continuation byte

    To Fix UnicodeDecodeError: 'utf8' codec can't decode byte 0xe9 in position 10: invalid continuation byte Error just Check the file. Here you have to check if you're manipulating a file that was just opened in 'rb' mode. Just make sure about it.

Solution 1 : Change the encoding to latin-1

Here you have to change the encoding to latin-1. You can see this in below command.

pd.read_csv('ml-100k/u.item', sep='|', names=m_cols , encoding='latin-1')

Solution 2 : Check the file

Here you have to check if you’re manipulating a file that was just opened in ‘rb’ mode. Just make sure about it.

Solution 3 : Run the command

If the error is UTF-8. Then just use the given below command to solve it.

pd.read_csv('File_name.csv',encoding='latin-1')

Solution 4 : Save file as a UTF-8 encoding

To solve the error you have t just click on file -> save as and I saved this file as a UTF-8 encoding and your error will be solved.

Conclusion

So these were all possible solutions to this error. I hope your error has been solved by this article. In the comments, tell us which solution worked? If you liked our article, please share it on your social media and comment on your suggestions. Thank you.

Also Read These Solutions

Leave a Comment