Well, up to now I have been programming in Perl and had to encounter all the same problems in Perl. I went back to see what kind of things I did to confront the problem there and it turns out that the solution was to change a setting in the database, the programming language had nothing to do with it.
So in order to get the character set corrected, before you make your query in
Python, you have to tell the database connection "SET NAMES 'utf8'". So a sample
Python code might be (this is a simple script, NOT a plug-in) ...
#!/usr/bin/python
import MySQLdb
db = MySQLdb.connect("Your_MySQL_Host","Your_MySQL_User","Your_MySQL_User_Password","Your_Database" )
cursor = db.cursor()
cursor.execute("SET NAMES 'utf8'")
cursor.execute("SELECT Your_Field FROM Your_Table")
results = cursor.fetchall()
for row in results:
trial_nam = row[0]
print trial_nam
db.close()
That did it. Problem Solved.
There is an excellent tutorial on using MySQL with
Python here,
http://www.tutorialspoint.com/python/python_database_access.htm