当有中文传递给jinja2模板会报如下错误:
UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xe6 in position 0: ordinal not in range(128)
解决方法:
import sys
reload(sys)
sys.setdefaultencoding(‘utf-8’)
文章转载来自:
猜你喜欢
QQ:800-70898
156-3892-6688