如果你是读数据库,显示在JSP面中,应该这样:<%@ page contentType="text/html;charset=gb2312"%>

解决方案 »

  1.   

    如果是写入数据库,这需要:String name=rs.getString("Fname");
    String temp=new String(name.getBytes("ISO8859_1"),"GB2312");
      

  2.   

    应用服务器要设置:
    file.encoding=GB2312

    file.encoding=GBK
      

  3.   

    从数据库中取出,如果是乱码,可以这样转:
    msgTxt=new String (msgTxt.getBytes("ISO-8859-1"),"gb2312");//code convertation
    如果是存入数据库成乱码,则
    msgTxt=new String (msgTxt.getBytes("gb2312"),"ISO-8859-1");//code convertation
    我就是这样处理的,没有问题阿
    给你两个连接,去看看
    http://www.csdn.net/expert/topic/711/711018.xml?temp=7.930934E-03
    http://www.csdn.net/expert/topic/711/711826.xml?temp=.625271