Solve Python running error:
UnicodeDecodeError: 'gbk' codec can't decode byte 0xb0 in position 166: illegal multibyte sequence
Reason: file decoding problem
Solution: add attribute:, encoding='utf-8'
example:response = open(path, 'r', encoding='utf-8')
Similar Posts:
- [Solved] Error when Python reads a file Unicode decodeerror
- [Solved] Python Error: UnicodeDecodeError: ‘gb2312’ codec can’t decode byte 0xa4 in position… : illegal multibyte sequence
- [Solved] Yaml Text Error: UnicodeDecodeError: ‘gbk‘ codec can‘t decode byte : illegal multibyte sequence
- [Solved] UnicodeDecodeError: ‘gbk’ codec can’t decode byte 0x80 in position 128: illegal multibyte sequence
- [Solved] Pycharm Pytest Error: UnicodeDecodeError: ‘gbk’ codec can’t decode byte 0xaa in position 171: illegal multibyte sequence
- Python Open File SyntaxError: (unicode error) ‘unicodeescape’ codec can’t decode bytes in …
- [Solved] UnicodeDecodeError: ‘gbk’ codec can’t decode byte 0xa5 in position 1508: illegal multibyte sequence
- [Solved] Unicode decode error in the background when the robot framework is running
- [Solved] UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0x89 in position 0: invalid start byte
- UnicodeEncodeError: ‘ascii’ codec can’t encode characters in position 0-1: