lchl0388 发表于 2017-4-22 08:38:06

Python中的编码错误问题

设置python运行环境的编码参考这里   http://diveintopython.org/xml_processing/unicode.html

《Dive Into Python》 的 Example 9.15. sitecustomize.py
# sitecustomize.py
# this file can be anywhere in your Python path,
# but it usually goes in ${pythondir}/lib/site-packages/
import sys
sys.setdefaultencoding('utf-8')



SQLAlchemy的问题请参考这里
http://firefish.blog.iyunv.com/298258/112794
create_engine(connstr+"?charset=utf-8", encoding='utf8', convert_unicode=True)
页: [1]
查看完整版本: Python中的编码错误问题