用response.setContentType("text/html; charset=gb2312")不能解决
从数据库读取数据的乱码问题?还必须做相应的转换;http://expert.csdn.net/Expert/topic/1998/1998503.xml?temp=.5411341

解决方案 »

  1.   

    显示:
    String show_str=new String(old_str.getBytes("ISO8859_1"),"GB2312");入库:
    String show_str=new String(old_str.getBytes("GB2312_1"),"ISO8859");
      

  2.   

    看你用什么数据库了。oracle的是utf-8。在servlet中设置了setCharacterEncoding就不用转码了。
      

  3.   

    呵呵,还是用oracle的DB吧。虽然有时候utf-8编码会出现丢字的情况