Encoding in tuple Python

ε祈祈猫儿з 提交于 2020-03-27 04:50:18

问题


I have an array containing SQL query result. I need to convert this array in tuple to make a request like this:

t = tuple(data)
querysring="INSERT INTO %s VALUES %s "%(table,t)
cur.execute(querysring)

But my array contains values like ['François','données'] and when I convert this in tuple it's make and insert 'Fran\xc3\xa7ois' in my database.

I have try to decode and encode (utf-8) but it seem not working.

Any suggestions ?

来源:https://stackoverflow.com/questions/43629059/encoding-in-tuple-python

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!