Hello community, I noticed that in db when I create some items with spaces in name, that items appears with unicode hex character . For example: mysql> select nombre from tgrupo where id_grupo='191'; +------------------------------+ | nombre | +------------------------------+ | Любанский МУ | +------------------------------+ 1 row in set (0.00 sec) Please give me advice how can I decode this character in python? For example I want to create dependence with group name and group id (there is no api function as I know): import MySQLdb db = MySQLdb.connect(host="localhost", user="root", passwd="pandora", db="pandora", charset='utf8') id='Любанский МУ' sql="select id_grupo from tgrupo where nombre='%s'" % id cursor.execute(sql) 0L print cursor.fetchall() () But: id = 'Любанский МУ' sql="select id_grupo from tgrupo where nombre='%s'" % id cursor.execute(sql) print cursor.fetchall() ((191,),)
Inicio del debate
