when I insert a query in mysql, I do the following:
execute( query. encode (utf8))
(query. encode (utf8))
我首先让字符串与 Unicode 兼容, 然后执行 。
Now when I am retrieving the data again from sql to my python code, do I need to make it unicode compatible again by applying encode function? If yes, then sql returns block of rows, How do I encode all?
我使用 cursor. fetchall ()
. 如何使行的每个元素与 Unicode 兼容?