0

I have a table:

CREATE TABLE `msg` (
  `content` varchar(255)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

And trying to insert the string 'I You':

INSERT INTO `msg` (`content`) VALUES ('I  You');

But getting error:

Incorrect string value: '\xF0\x9F\x92\x9A Y...' for column 'content' at row 1

I think UTF-8 can accommodate any characters. Then why this error?

Mohammed H
  • 6,880
  • 16
  • 81
  • 127
  • I'd say you'd need to convert to `TEXT` rather than `VARCHAR` to be honest. Judging from the error thrown its over your limit. – Option Feb 24 '17 at 10:09
  • 1
    You might want to check this answer [“Incorrect string value” when trying to insert UTF-8 into MySQL via JDBC? ](http://stackoverflow.com/questions/10957238/incorrect-string-value-when-trying-to-insert-utf-8-into-mysql-via-jdbc) – Roman B. Feb 24 '17 at 10:13

0 Answers0