发布时间:2019-09-11 07:46:57编辑:auto阅读(2507)
用python,之前运行的很好,但是
UnicodeDecodeError: 'utf8' codec can't decode byte 0xc4 in position 4: invalid continuation byte
添加了
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
中文
decode('utf-8')
还是报错,
最后发现python运行的机器,编码不是utf8,修改/etc/profile
修改编码即可
export LANG=en_US.UTF-8
【你遇到的问题,可能不一定是这个问题,仅供参考】
个人微博:http://weibo.com/h2fly
上一篇: SQL Server分页3种方案比拼
下一篇: Python升级3.6.5
51669
51311
41761
38537
33014
30030
28705
23687
23605
21963
2153°
2860°
2379°
2321°
2861°
2333°
3122°
5109°
4949°
3540°