How to show Emoji from database in Grails

385 views Asked by At

I want to save nickname from wechat to Mysql and show it exactly in HTML.The problem is the nickname may contain emoji. Now I can save emoji to Mysql(Switching from MySQL’s utf8 to utf8mb4).But how to show it? Is there any solution?(I use Grails and Mysql.)

1

There are 1 answers

3
defectus On

I believe you have to set your JDBC connection string, URL, (in Datasource.groovy) to include

jdbc:mysql://server_ip:server_port/db_name?useUnicode=true&characterEncoding=utf-8