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.51cto.com/298258/112794

create_engine(connstr+"?charset=utf-8", encoding='utf8', convert_unicode=True)

你可能感兴趣的:(html,xml,python,Blog)