This topic created in 4343 days ago, the information mentioned may be changed or developed.
我用mysqldb 存入与取出都是utf8编码。 但python内部是unicode的,所以每次我都还要将从数据库取出的数据转换成unicode, 很是麻烦与低效, 有什么办法让mysqldb取出的就是unicode编码的吗?
def _dict_to_unicode(self, d):
d = json.dumps(d, ensure_ascii = False)
d = json.loads(d)
return d