Have an error : Incorrect string value when input in other languages

I have the problem when input the acronym data with other language instead of English. (such as Thai or japanese )

This is the error after submit the input form.

{“error”:true,“reason”:“Incorrect string value: ‘\xE0\xB8\x97\xE0\xB8\x94…’ for column ‘long’ at row 1”}

Appreciated if anyone could share and advice .

Best Regards,
Thammaporn

@0xtim Can you please help with this when you get a chance? Thank you - much appreciated! :]

Hmm I suspect the DB isn’t accepting unicode, just ASCII. That probably requires a bit of custom set up - try asking in the Vapor Discord chat to see if anyone else has come across that!

@0xtim

Thanks for the advice. You’re right.
Now I can solved the problem.

After I recreated the image like below. It is work.

docker run --name mysqltil -e MYSQL_USER=swift -e MYSQL_PASSWORD=password -e MYSQL_DATABASE=vapor -p 3306:3306 -d mysql/mysql-server:5.7 --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci

1 Like