I was trying to insert multiple language support.
So I set name field collation as utf-8 general cli.
When I directly run the below sql query in workbenck. It was inserting the same language.
INSERT INTO `samba`.`userprofile`(`email`,
`name`,
`pass`,`passcode`)
VALUES
('ands@gme1d22.com','ญาณทัสนะ','ana','awer');
When I trying to insert over python script I was inserting like "à¸à¸²à¸“ทัสนะ"
here my python script.
# -*- coding: utf-8 -*-
from gettext import gettext as _
import MySQLdb
try:
db = MySQLdb.connect("localhost","root","password","samba" )
cursor = db.cursor()
except:
print "Database Not Connected"
sys.exit(1)
query = """
INSERT INTO `samba`.`userprofile`(`email`,
`name`,
`pass`,`passcode`)
VALUES
('ands@gme1d22.com','ญาณทัสนะ','ana','awer');
"""
cursor.execute(query)
db.commit()