mardi 19 août 2014

Str with characters is not stored properly in MySQL


Vote count:

0




I am connecting through pyodbc and obtaining some data under utf8.


one of the objects returned by the query is a type str and looks like this



a = '1001\xc3\xa2\xe2\x82\xac\xe2\x80\x9c1015'


However when I do a print a I get:



1001ââ¬â1015


The same line is also stored in a MySQL database which I also connect using utf8.


Any ideas why this is happening? The correct text should be:



1001-1015


the character is an ndash.



asked 47 secs ago







Str with characters is not stored properly in MySQL

Aucun commentaire:

Enregistrer un commentaire