python - UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc7 in position 187: invalid continuation byte

最近在做bytes转str时,出现报错

str(test, encoding='utf-8')

改成 GB2312、gbk、ISO-8859-1 就没报错

str(test, encoding='GB2312')
str(test, encoding='gbk')
str(test, encoding='ISO-8859-1')
posted @ 2023-06-08 19:26  wstong  阅读(27)  评论(0编辑  收藏  举报