First they ignore you
then they ridicule you
then they fight you
then you win
    -- Mahatma Gandhi
Chinese => English     英文 => 中文             
随笔-221  评论-1047  文章-0  trackbacks-0

其实Grails用MySQL数据源处理中文还是很方便的,基本只要注意2点:

  1. 在xxxDataSource.groovy里,mysql url注意要加上参数,例如:jdbc:mysql://server?useUnicode=true&characterEncoding=UTF-8

  2. MySQL数据库要用UTF-8编码

// 山风小子注: < meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

另外,gsp里要注意:content="text/html; charset=UTF-8"

默认应该就是这样。


原文地址:http://ev0.javaeye.com/blog/94990

附:朝花夕拾——Groovy & Grails



posted on 2007-06-28 06:03 山风小子 阅读(1785) 评论(5)  编辑  收藏 所属分类: Groovy & Grails