-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UTF-8 character encoding #40
Comments
Oh, I thought my answer was wrong after I posted it so I deleted it. I'll attach it here again in case another user has the same issue. Set the encoding like this:
|
Maybe someone finds useful to specify the encoding in
This seems to work for me well. |
@brettwooldridge sorry for messaging on a closed thread, I am trying the same appoarch as you mentioned about config.add for utf-8, but I still see the issue of garbled characters. Code works if I use plain jdbc; below is my property file //hikari.properties @configuration
} this is a spring boot application, please advise |
I can't seem to be able to get data encoded in UTF-8 (cyrilic , arabic alphabets etc) from my MySQL database. Everything else works correctly and as expected.
Without HikariCP (no connection pooling) I used "useUnicode=true&characterEncoding=UTF-8" as a property for my connection and it worked.
With HikariCP i tried something similar for the configuration:
config.addDataSourceProperty("url", "jdbc:mysql://localhost:3306/db?useUnicode=true&characterEncoding=UTF-8");
I also tried using the following:
config.addDataSourceProperty("characterEncoding",Charsets.UTF_8.name());
config.addDataSourceProperty("useUnicode","true");
Neither worked, the cyrilic characters were shown as ???.
My MySQL version is 5.5.27, but like i said without using connection pooling the character were shown correctly.
Any suggestions/ideas?
The text was updated successfully, but these errors were encountered: