I am using a stored procedure to get some rows from mysql databse.
I using very basic syntax:
retarr = []
cursor.callproc("employee_get", (-1, -1, -1))
for res in cursor.stored_results():
retarr.append(res.fetchall())
cursor.close()
...
Now. Some of data results are unicode strings. I use UTF-8 for encoding string in my database. I use charset="utf8" and use_unicode=True in my connection.
The problem occurs when i try to print any catched data (whole data tuple) which contain unicode characters. Like:
for row in retarr[0]:
print(row)
it prints me the first catched row properly. But the first has no unicode character. Then comes the second and all i get is an famous error: UnicodeEncodeError: 'ascii' codec can't encode character '\u0119' in position 19: ordinal not in range (128). What's the problem? I believe i am missing something very basic.
I use Python 3.3.2, standard mysql connector. OSX.
UnicodeEncodeErroroncmd.exewhere it works fine in IDLE. - cdarke