I am dealing with some external APIs, and when I save to the db, I am receiving some encoding errors, All the content I am dealing with is in unicode; but the mysql encoding is set ti latin1.
It seems to work fine on my local system, but throws error on the server. The only difference between the environments is that the local runs python2.6 whereas the remote server runs, python2.5
Following are the mysql specifications:
mysql> SHOW VARIABLES LIKE "character\_set\_database";
+------------------------+--------+
| Variable_name | Value |
+------------------------+--------+
| character_set_database | latin1 |
+------------------------+--------+
1 row in set (0.00 sec)
mysql> SHOW VARIABLES LIKE 'character\_set\_%';
+--------------------------+--------+
| Variable_name | Value |
+--------------------------+--------+
| character_set_client | latin1 |
| character_set_connection | latin1 |
| character_set_database | latin1 |
| character_set_filesystem | binary |
| character_set_results | latin1 |
| character_set_server | latin1 |
| character_set_system | utf8 |
+--------------------------+--------+
7 rows in set (0.00 sec)
And following is the error I encounter:
Incorrect string value: '\xCB\x8Cs&ae...' for column 'content' at row 1
What mysql setting changes should I do, to not deal with encoding issues again.