<%@ page contentType="text/html;charset=gb2312"%>,编码不同

解决方案 »

  1.   

    安装最新的Tomcat 4应该没有问题。
      

  2.   

    在你的jsp页面中加上
    <%@ page language="java" contentType="text/html;charset=GB2312" %>
    <meta http-equiv="Content-Type" content="text/html; charset=GBK">
      

  3.   

    public static String Ch(String in){
            String s = null;
            byte[] temp;
            if (in == null){
                System.out.println("Warn:Chinese null found!");
                return new String("");
             }
            try{
                temp=in.getBytes("iso-8859-1");
                s= new String(temp);
            }catch(Exception e){
                System.out.println (e.toString());
            }
            return s;
        }
        /**
         * 功  能:转换成iso8859-1
         */
        public static String deCh(String in){
            String s = null;
            if (in == null){
                System.out.println("Warn:Chinese null found!");
                return new String("");
             }
            try{
                s=new String(new String(in).getBytes("GBK"),"ISO8859_1");
            }catch(Exception e){
                System.out.println (e.toString());
            }
            return s;    }
      

  4.   

    请zxl19790710(雪龙)不要再贴这种被deprecated的代码。
      

  5.   

    <%@ page contentType="text/html;charset=ISO8851-1"%>,