#!/usr/local/bin/python
#-*-coding:utf-8-*-
import MySQLdb
<skip>
cur.execute("SET NAMES utf8;")
cur.execute("SET CHARACTER SET utf8;")
cur.execute("SET character_set_connection=utf8;")
<skip>
cur.execute("insert into categories (cid,name_e,name_r) values ('0','blog','Блог')")
<skip>
Traceback (most recent call last):
File “./crt.py”, line 25, in <module>
cur.execute(“insert into categories (cid,name_e,name_r) values ('0','blog','п▒п╩п╬пЁ')”)
File “/usr/local/lib/python2.5/site-packages/MySQLdb/cursors.py”, line 146, in execute
query = query.encode(charset)
UnicodeDecodeError: ‘ascii’ codec can't decode byte 0xd0 in position 63: ordinal not in range(128)
Как бороться не знаю . Нуна помощь . Спасибо!