Home > Software engineering >  "Incorrect string value" when trying to insert UTF-8 into MySQL from Rails
"Incorrect string value" when trying to insert UTF-8 into MySQL from Rails

Time:02-28

While debugging my Rails App I found the following messages in the log file:

(0.1ms)  ROLLBACK
Completed 500 Internal Server Error in 25ms (ActiveRecord: 4.2ms)
ActiveRecord::StatementInvalid (Mysql2::Error: Incorrect string value: '\xF0\x9F\x98\x89 u...' for column 'description' at row 1: INSERT INTO `course` (`title`, `description`) VALUES ('sometitle', '<p>Description containing            
  • Related