Problems saving Japanese characters to mysql via python-mysqldb
I tried following the 开发者_如何学编程instructions here in my python script running on Ubuntu:
http://www.dasprids.de/blog/2007/12/17/python-mysqldb-and-utf-8
But I can't seem to save japanese characters properly. They keep appearing as '?!?!?!' in the database. I can, however, save japanese characters from the mysql command line prompt itself, so the problem definitely seems to lie with python and mysqldb side of things.
I used this : c.execute("insert into testing (test) values (%s)",(var_containing_japchars))
Does anyone know what the problem is ?
With php, I have to execute the SET NAMES 'utf8'
query before I execute queries containing Japanese correctly. Have you tried this?
精彩评论