Supplementary character support in Java web application with Mysql

71 views Asked by At

I am able to enter supplementary chars in textbox but it doesn't get save in database. I am using MySql database. I have used spring and hibernate in my application. What change should I make to enable supplementary chars support in my application?

Following is my database connection string:

url="jdbc:mysql://localhost:3306/users?useUnicode=true&characterEncoding=utf8"
1

There are 1 answers

0
Indrabhushan On

You need to do following changes to make your application supplementary character compatible:

  1. Remove characterEncoding i.e. utf8 from your url and make it as below:

    url="jdbc:mysql://localhost:3306/users?useUnicode=true"

  2. You need to edit my.ini file from MySQL Server directory. If you have Windows 64bit OS, then you may find it at following location:

    C:\ProgramData\MySQL\MySQL Server 5.6\my.ini

Open this file using any text editor such as Notepad++ and change the following parameter value:

From

character-set-server=utf8

To

character-set-server=utf8mb4

After making the above changes your application should support Supplementary characters.