App JavaDataInputStream JDBC-MariaDB MariaDB
I want to store pictograms in the order of, but the stored characters are ?????. (Only the emoji part)
Not all emojis do, but surrogate pairs.
Of course, if it is only normal characters, it will be stored normally.
We have confirmed that the database table is utf8mb4 and the column is also utf8mb4.
I am getting a connection with useUnicode = true & characterEncoding = utf8mb4.
I also tried set names utf8mb4, but it didn't work either.
No matter what I do, it is saved as ???, but where can I go?
Postscript I still can't solve it
□ What I know is absolute-The table is normally utf8mb4 Checked on a column-by-column basis Before doing this, an exception occurred, but after doing this, the exception no longer occurs.
In the first place, it can be stored without passing through a connection.
・ Connection is 1.2.3 (mariadb java)
What about surrogate pairs? The bug that becomes is found by the person who answered here that it has been fixed
・ Application ← → Server communication is working well.
If you echo it as it is without storing it in the DB, it will be displayed normally.
-The bad thing is that you can store surrogate pairs normally in MariaDB connection terminals.
Also, are you suspicious of using PrepareStatement?
(The one that escapes and replaces?)
・ Specify the following for the connection (remember)
useUtf = tru charset = utf8mb4
-When the data arrives at MariaDB, is it not garbled in the first place? It seems that it has been replaced with the character.
After all, is it due to conversion in the connection?
In short, it seems that MariaDB Connection Java is absolutely bad, but I'm in great trouble.
Addendum I was able to add additions! !! !! !! !! !! !! !! !! !! !! !!
Cause It was his utf-8 that was the client_character of the SQL function stored procedure.
client_ for stored procedures (such as functions) was still
No way, I didn't realize that the stored procedure also had a character code setting, and it took a tremendous amount of time to solve it.
By the way, the settings I was able to execute are as follows.
(Since there seems to be a lot of setting troubles)
show create PROCEDURE xxxxxxx;
utf-8 , followed by
/etc/my.cnf (only necessary parts)
collation_server=utf8mb4_unicode_ci character-set-server=utf8mb4 [mysql] default_character_set=utf8mb4 [client] default-character-set=utf8mb4
DriverManager.getConnection("jdbc:mariadb://localhost/" + D.DataBaseName + "?user=" + D.DataBaseUser + "&password=" + D.DataBasePass + "&autoReconnect=true&useUnicode=true&characterEncoding=utf8mb4&connectionCollation=utf8mb4_general_ci");
No issue of
set names etc.
I also don't use
The character code of the table is
It seems that the character code can be specified even for each column of the table, so that is also