|
MYSQL在终端下中文显示正常,但在JSP调用显出乱码!
我在/etc/mysql/my.cnf中加了default-character-set=utf8
[mysqld]
#
# * Basic Settings
#
user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
language = /usr/share/mysql/english
default-character-set=utf8
skip-external-locking
用JSP查询显示乱码,用(new String(string.getBytes("ISO-8859-1"),"gb2312")还是显乱码
用<%@ page contentType="text/html; charset=GB2312;pageEncoding="gb2312"%>还是显乱码
上面的编码中用UTF-8,GBK,GB2312,LATIN1,ISO-8859-1等编码试过了,结果还是乱码,不知道是何原因??? |
|