anonym
anonym

Reputation: 17

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc7 in position 237: invalid continuation byte

I am trying to open a 14.6GB .lst file. Which encoding should I use? I always get the error, I am using Python3

  File "fb.py", line 58, in <module>
    passw=file.readline().strip()
  File "/usr/lib/python3.7/codecs.py", line 322, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc7 in position 237: invalid continuation byte

Upvotes: 0

Views: 638

Answers (1)

Bert
Bert

Reputation: 2244

You don't have utf-8 data. Try changing the encoding to "ISO-8859-1" in your open() statement.

Upvotes: 1

Related Questions