Source Code:
(back to article)
try: byte_string = b'\xa5' # contains an invalid start byte for UTF-8 text = byte_string.decode('utf8') except Exception as e: print(e)
Result:
Report an issue