[Solved] Python error: UnicodeDecodeError:’gbk’ codec can’t decode byte 0xb0 in position 166: illegal multibyte sequence

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:

Leave a Reply

Your email address will not be published. Required fields are marked *