I have my mariadb where I have some text on russian language(which I add by INSERT INTO test VALUES(1, "Абвг Деёжзий", "2138712894-213123", true)
) And I have my python code:
import MySQLdb
connection=MySQLdb.connect(user="t", password="t", host="127.0.0.1", database="project")
cursor = connection.cursor()
cursor.execute("SELECT * FROM test;")
for a,b,c,d in cursor:
print(a,b,c,d)
And as the output I have this:
1 ???? ??????? 2138712894-213123 1
(Where ???? ??????? is one string with space on russian)
I tried SET CHARACTER SET utf8
and SET NAMES utf8
but I didn't have the right output. What should I do to get the text.