Closed swordfeng closed 5 years ago
you can try to set a charset
option on the configuration. see DEFAULT_CHARSET here: https://github.com/vert-x3/vertx-mysql-postgresql-client/blob/12a6e6f894/vertx-mysql-postgresql-client-jasync/src/main/java/io/vertx/ext/asyncsql/impl/MYSQLClientImpl.java
Although I haven't tested it myself.
Yes, I see. I couldn't find the value for the utf8mb4 in mysql docs. what I did find is that this is the default since 8.0.1.
If you have an idea of that value we can try that out.
I think the “SHOW COLLATION” statement should give you the id. An example: https://dev.mysql.com/doc/refman/8.0/en/charset-mysql.html
from reading this post. it looks like older utf in mysql was not totally compatible.
What I think to do is to change utf8 type in the protocol like this: CharsetUtil.UTF_8 to 224
.
I tested it and it works. it might affect legacy databases that do not support this charset.
I will open an issue in jasync-sql
itself for this.
@swordfeng - you're welcome to test it with jasync 0.9.50.
@oshai Tested and it looks good! I think I can close the issue now. Thanks!
The client is creating connections using the default charset mapping, which maps UTF_8 to utf8mb3. However, many DBs use utf8mb4 in order to support 4-byte unicode. Is there a way to customize the charset settings? Maybe passing in a CharsetMapping as a parameter or specifying a charset code.