当前位置:Gxlcms > 数据库问题 > 关于python2.7从数据库读取中文显示乱码的问题解决

关于python2.7从数据库读取中文显示乱码的问题解决

时间:2021-07-01 10:21:17 帮助过:44人阅读

2、在输出数据的时候需要编码:data[0][0].encode("UTF-8"),如果不编码则会报错:

UnicodeDecodeError: ‘ascii‘ codec can‘t decode byte 0xe5 in position 0: ordinal not in range(128)




关于python2.7从数据库读取中文显示乱码的问题解决

标签:2.7   close   utf8   mysql   set   port   span   乱码   ascii   

人气教程排行