acambeiro
acambeiro

Reputation: 33

Play framework JDBC ebean mysql exception with characters řů but accepts áõ

Trying to save models and i get a:

java.sql.SQLException: Incorrect string value: ...

Saving a text like "jedna dva tři kachna dům a kachní maso"

I'm using default.url="jdbc:mysql://[url]/[database]?characterEncoding=UTF-8"

Upvotes: 0

Views: 317

Answers (2)

Rick James
Rick James

Reputation: 142208

řů have no encoding in latin1; áõ do. That suggests that CHARACTER SET latin1 is involved somewhere. Let's see SHOW CREATE TABLE.

C599, etc, are valid utf8 encodings for the corresponding characters.

? occurs when the destination character set cannot represent the character. Again, this points to the column/table being latin1, when it should be utf8 (or utf8mb4).

More discussion, and for debugging similar situations: Trouble with utf8 characters; what I see is not what I stored

Upvotes: 1

Leonardo Ramos Duarte
Leonardo Ramos Duarte

Reputation: 292

Probably has some special character, and the UTF-8 encode that you are forcing may cause some error.

This ASCII string has the following text:

String:

jedna dva tři kachna dům a kachní maso

ASCII:

'jedna dva t\xc5\x99i kachna d\xc5\xafm a kachn\xc3\xad maso'

Upvotes: 0

Related Questions