Jayakrishnan
Jayakrishnan

Reputation: 671

I am facing an error while i try to load a file in python 3

f = open(path,'r',encoding='utf8')

This is the code I'm trying to run but it outputs 'utf-8' codec can't decode byte 0x80 in position 0: invalid start byte as the error. What might be the reason for this?

Upvotes: 0

Views: 108

Answers (1)

Daniil Rose
Daniil Rose

Reputation: 123

Try changing your encoding to utf-8, and see if that fixes it. Otherwise, the file might not be encoded in utf-8.

Upvotes: 1

Related Questions