On 28/05/2013 17:00, Νίκος Γκρ33κ wrote:
I do not know here to find connections.py Michael.
But i do not understand since iam suing the following 2 statements, why a
unicode error remains.
#needed line, script does *not* work without it
sys.stdout = os.fdopen(1, 'w', encoding='utf-8')
# connect to database
con = pymysql.connect( db = 'pelatologio', host = 'localhost', user = 'myself',
passwd = 'mypass', init_command='SET NAMES UTF8' )
cur = con.cursor()
Shall i chnage the connector form 'pymysql' => 'MySQLdb' ?
A quick look at the documentation tells me that the charset can be
specified in the 'connect' call, something like this:
con = pymysql.connect( db = 'pelatologio', host = 'localhost', user =
'myself', passwd = 'mypass', init_command='SET NAMES UTF8', charset =
'utf-8' )
--
http://mail.python.org/mailman/listinfo/python-list