/*SQL SERVER乱码*/
<%@ page contentType="text/html;charset=gb2312""%>
String str=rs.getString("XXX");
result=new String(str.getBytes("ISO8859_1"),"gb2312");

解决方案 »

  1.   

    用的javaBean,代码是如下,就算是直接提交中文也是乱码,大家看看
    /*
     * Created on 2004-6-25
     *
     * To change the template for this generated file go to
     * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
     */
    package myPackage;/**
     * @author hp
     *
     * To change the template for this generated type comment go to
     * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
     */
    public class zhuce {
      public zhuce()
      {
      }
      private int id;
      private String name;
      private String sex;
      public void setId(int id)
      {
       this.id=id;
      }
      public void setName(String name)
      {
       this.name=name;
      }
      public void setSex(String sex)
      {
       this.sex=sex;
      }
      public int getId()
      {
       return id;
      }
      public String getName()
      {
       return name;
      }
      public String getSex()
      {
       return sex;
      }
    }
      

  2.   

    我也遇到这样的问题啊,写进ACCESS是正确的,写进mysql就是乱码!