Grails not encoding the unicode characters properly

后端 未结 2 1897
小蘑菇
小蘑菇 2020-12-06 13:50

In my grails app, the unicode characters are not being encoded properly.

I\'m using grails 1.3.7 and tomcat 7.0.22. Following are the settings that I\'ve configured

2条回答
  •  一整个雨季
    2020-12-06 14:21

    Setting the Dialect to UTF-8 is not going to work. You have to also modify the tables or the columns of your table to support UTF-8.

    Here is the command to alter the table

    ALTER TABLE tbl_name CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
    

    or you can try to just modify the column in which you want to store utf-8

    using the command

    ALTER TABLE t MODIFY col1 CHAR(50) CHARACTER SET utf8;
    

提交回复
热议问题