是呀,我也想知道,怎么解决呀~~~~~~~~~~~~~~~~~

解决方案 »

  1.   

    1.進行字符的轉換.要寫函數.一般第一個函數TranStrType就可以了.但有時用其他函數多試幾次
    <%!
    public String TranStrType(String str) throws Exception
    {
    byte[] _tempByte=str.getBytes("ISO8859-1");
    String _tempStr=new String(_tempByte);
    return _tempStr;
    }public static String ISOtoGBK(String strvalue) 

    try{ 
    if(strvalue==null) 
    return null; 
    else 

    strvalue = new String(strvalue.getBytes("ISO8859-1"),"GBK"); 
    return strvalue; 

    }catch(Exception e){ 
    return null; 


    public static String ISOtoGB2312(String strvalue) 

    try{ 
    if(strvalue==null) 
    return null; 
    else 

    strvalue = new String(strvalue.getBytes("ISO8859-1"),"gb2312"); 
    return strvalue; 

    }catch(Exception e){ 
    return null; 

    }
    public static String ISOtoBIG5(String strvalue) 

    try{ 
    if(strvalue==null) 
    return null; 
    else 

    strvalue = new String(strvalue.getBytes("ISO8859-1"),"big5"); 
    return strvalue; 

    }catch(Exception e){ 
    return null; 


    public static String Gb2312toISO(String strvalue) 

    try{ 
    if(strvalue==null) 
    return null; 
    else 

    strvalue = new String(strvalue.getBytes("gb2312"), "ISO8859-1"); 
    return strvalue; 

    }catch(Exception e){ 
    return null; 


    public static String GBKtoISO(String strvalue) 

    try{ 
    if(strvalue==null) 
    return null; 
    else 

    strvalue = new String(strvalue.getBytes("gbk"), "ISO8859-1"); 
    return strvalue; 

    }catch(Exception e){ 
    return null; 

    }
    public static String GIG5toISO(String strvalue) 

    try{ 
    if(strvalue==null) 
    return null; 
    else 

    strvalue = new String(strvalue.getBytes("big5"), "ISO8859-1"); 
    return strvalue; 

    }catch(Exception e){ 
    return null; 

    }
    %>
    2.用Tomcat4.0.
    這個版本的Tomcat再直接連接中文名的文件不會出現找不到文件的情況.而4.1則不行4.在JSP文件第一行加
    <%@ page contentType="text/html;charset=big5"%>(繁體 )
    <%@ page contentType="text/html;charset=gb2312"%>(簡體 )5.在html的head中加入
    <meta http-equiv="Content-Type" content="text/html; charset=big5">(繁體 )
    <meta http-equiv="Content-Type" content="text/html; charset=gb2313">簡體 )