报错信息:
UnicodeEncodeError: 'gbk' codec can't encode character 'xXX' in position XX
解决办法:
import io
import sys
sys.stdout = io.TextIOWrapper(sys.stdout.buffer,encoding='gb18030')
# 由于编码为utf-8时,会默认执行严格模式,可以使用以下代码来执行肥严格模式的decode
data.decode("utf-8", "ignore")