user2759596
user2759596

Reputation: 3

Spring boot, Hibernate JPA MySQL 5.7 Incorrect string value: '\xE8....' for column

I am getting Incorrect string value: '\xE8.....' for column ...

I have set char encoding to utf8mb4 on Database (MySQL 5.7.23) and jdbc url i have appended ?useUnicode=yes&characterEncoding=UTF-8&useSSL=false

Still I am getting error from Hibernate

2022-04-13 00:34:35.083 WARN 8 --- [ad Pool Data -7] o.h.e.j.s.SqlExceptionHelper : SQL Error: 1366, SQLState: HY000 2022-04-13 00:34:35.083 ERROR 8 --- [ad Pool Data -7] o.h.e.j.s.SqlExceptionHelper : Incorrect string value: '\xE8....' for column '....' at row 1

What I am missing here.

Upvotes: 0

Views: 854

Answers (1)

Rick James
Rick James

Reputation: 142278

You were expecting a grave-e (è)? The configuration you present disagrees with the encoding of the source. E8 is probably latin1 or cp1256, not UTF-8.

Either fix the source data be hex C3E8 so that it agrees with ?useUnicode=yes&characterEncoding=UTF-8 or change that setting.

Upvotes: 0

Related Questions