When inserting the string “Up to HM77 based models − Intel® Core™ i5” mysql is giving error “Incorrect string value: ‘\xE2\x88\x92 In…’ for column ‘spec_1′”.
I know this has something to do with characters getting copied from MS-Office.
I have got some idea from this but still dont know why it is happening. What is the best way to resolve this?
Edited to add sqlfiddle on request–
You can try the below query in sqlfiddle.com to get the idea of the error
CREATE TABLE product_content ( spec_1 varchar(1000) DEFAULT NULL ) ENGINE=InnoDB AUTO_INCREMENT=1752 DEFAULT CHARSET=latin1; insert into product_content (spec_1) values('Up to HM77 based models − Intel® Core™ i5')
Changed the charset to UTF-8 and it resolved the issue.
It was showing row size too large because I was having lot of columns as varchar(1000). I changed those columns to TEXT/BLOB and it resolved the issue.
If you are having this issue then :
1) Change the encoding of the table to UTF-8
2) If while changing the encoding it shows “Row size too large”, check if you have lot of varchar columns.
3) Change those varchar columns to text/blob