Auf*_*ind 4 python unicode encoding utf-8 mysql-python
使用MySQLdb我连接到一个数据库,其中所有内容都以utf8编码存储.
如果我做
cursor.execute("SET NAMES utf8")
Run Code Online (Sandbox Code Playgroud)
并通过另一个语句从数据库中获取一些数据.这是否意味着,字符串在
cursor.execute("SELECT ...")
cursor.fetchall()
Run Code Online (Sandbox Code Playgroud)
将是unicode?或者我必须先把它们转过来
mystr.decode("utf8")
Run Code Online (Sandbox Code Playgroud)
unicode?
| 归档时间: |
|
| 查看次数: |
6664 次 |
| 最近记录: |