Hi,
Recently, I faced this issue with Java-MySQL connection. Upon looking at the stack-trace I could find the cause of this exception as follows:
Code:
java.sql.SQLException: Incorrect string value: '\xC2\x80\xC2\x99s+...' for column 'target' at row 1
'target' happens to be one of the columns of of a table in my schema and contains some http links in the form of strings. Surprisingly, the same code is running on three different machines but however, this Exception was observed only on one machine. Upon searching through forums, I could find that this issue has got something to do with the character encoding. So I just checked the LANG environment variable of the machines and found them all to be LANG= en_US.UTF-8 .
Further, I checked the MySQL connection variables and got the following results on all three machines:
Code:
mysql> SHOW VARIABLES LIKE '%_connection';
------------------------------------------------
Variable_name Value
------------------------------------------------
character_set_connection latin1
collation_connection latin1_swedish_ci
------------------------------------------------
Is there something that I'm missing out on that single machine?