Mysql写入中文出错
本地调试好像正常,服务器运行报错:
UnicodeEncodeError: 'latin-1' codec can't encode character u'\u5206' in position 2: ordinal not in range(256)
解决:
conn.set_character_set('utf8')
本地调试好像正常,服务器运行报错:
UnicodeEncodeError: 'latin-1' codec can't encode character u'\u5206' in position 2: ordinal not in range(256)
解决:
conn.set_character_set('utf8')