UnicodeDecodeError: ‘utf-8’ codec can’t decode byte...

1. 编码问题, 如果来源为编码为其他的,而是用utf-8去解码就会报错。

2. 如果只是有部分无法解码, 则添加   ‘ingnore’   参数

a = b'...'
result = a.decode('utf-8', 'ignore')

 

posted @ 2019-01-26 14:28  frange  阅读(1119)  评论(0编辑  收藏  举报