Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MySql UTF encoding

 java.sql.SQLException: Incorrect string value: '\xAC\xED\x00\x05sr...' for column 'xxxx'

The column is a longtext in MYSQL with utf8 charset and utf8_general_ci collation.

What is wrong?

like image 638
user121196 Avatar asked Dec 28 '22 19:12

user121196


2 Answers

It's a bit late, but you might want to know that \xAC\xED\x00\x05sr... is a magic number for Java serialization. Apparently your parameter is being serialized instead of being pasted as a string.

like image 72
Jakub Bochenski Avatar answered Dec 31 '22 07:12

Jakub Bochenski


Assuming that those are hexadecimal escape codes, the text \xAC\xED\x00\x05sr... is not a valid UTF-8 string.

like image 25
Mark Byers Avatar answered Dec 31 '22 07:12

Mark Byers