在表单里面,然后用
变量=new String(变量.getBytes("8859_1"),"gb2312");
不行吗?

解决方案 »

  1.   

    String sStr = request.getParameter("sElementName")==null?"":request.getParameter("sElementName") ;
    sStr = new String(sStr.getBytes("8859_1"),"gb2312");请在问问题时请到FAQ和精华区或用搜索一下.
      

  2.   

    byte[] tmpbyte=stringName.getBytes("ISO8859_1");
    stringName=new String(tmpbyte);
    不同的操作系统中文转码也不太一样
      

  3.   


    <%! String na=""; %>
    <%na=request.getParameter("nation");
    out.print(new String( na.getBytes("ISO8859_1"),"gb2312"));
      %> 一般能ok,try it
      

  4.   

    <%@page contentType="text/html;charset=gb2312"%>
    具体程序中需要转换的地方用.getBytes("ISO8859_1").