- WINDOWS下命令行执行报错,可以输入以下2条命令解决
chcp 65001 set PYTHONIOENCODING=utf-8
- 写日志时报错,说明变量有些字符是utf8,可以用下面方法解决
logging.error(“some log:” + unicode(input, ‘utf-8’))
chcp 65001 set PYTHONIOENCODING=utf-8
logging.error(“some log:” + unicode(input, ‘utf-8’))
No comments yet.
RSS feed for comments on this post.
Sorry, the comment form is closed at this time.
Powered by WordPress