'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.



Solution 1:[1]

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.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Rick James