Jul-21-2018, 03:07 PM
Please post your current code, outputs and errors?
Are you using Python3,right?
Are you getting this error?
Are you using Python3,right?
Are you getting this error?
Output:UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte
You can use replace
or ignore
when decoding:>>> b'\x80abc'.decode("utf-8", "strict") Traceback (most recent call last): ... UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 0: invalid start byte >>> b'\x80abc'.decode("utf-8", "replace") '\ufffdabc' >>> b'\x80abc'.decode("utf-8", "backslashreplace") '\\x80abc' >>> b'\x80abc'.decode("utf-8", "ignore") 'abc'