Sometimes, we want to fix UnicodeDecodeError, invalid continuation byte with Python.
In this article, we’ll look at how to fix UnicodeDecodeError, invalid continuation byte with Python.
How to fix UnicodeDecodeError, invalid continuation byte with Python?
To fix UnicodeDecodeError, invalid continuation byte with Python, we call decode
to decode the byte string with the right encoding.
For instance, we write
s = b'\xe9\x80\x80'.decode('utf-8')
to call decode
with 'utf-8'
on the byte string to decode it as a Unicode string.
Conclusion
To fix UnicodeDecodeError, invalid continuation byte with Python, we call decode
to decode the byte string with the right encoding.