我找到的:
    public static String URLDecode(String s)
        throws IOException
    {
        if(s == null || s.length() == 0)
            return "";
        if(s.indexOf(37) == -1)
            return s;
        StringBuffer sBuf = new StringBuffer(s.length());
        for(int i = 0; i < s.length(); i++)
            if(s.charAt(i) == '%' && i + 2 < s.length())
            {
                try
                {
                    sBuf.append((char)Integer.parseInt(s.substring(i + 1, i + 3), 16));
                }
                catch(Exception e)
                {
                    sBuf.append(s.substring(i, i + 3));
                }
                if(i + 2 >= s.length())
                    i = s.length();
                else
                    i += 2;
            } else
            {
                sBuf.append(s.charAt(i));
            }        return parseISO(sBuf.toString());
    }    public static String URLEncode(String s)
        throws IOException
    {
        if(s == null || s.length() == 0)
            return "";
        StringBuffer sBuf = new StringBuffer();
        s = parseGB(s);
        for(int i = 0; i < s.length(); i++)
        {
            int c = s.charAt(i);
            if(c > 122 || c < 48 || c > 57 && c < 65 || c > 90 && c < 97)
                sBuf.append("%".concat(String.valueOf(String.valueOf(Integer.toHexString(c)))));
            else
                sBuf.append((char)c);
        }        return sBuf.toString();
    }大家可以参考一下,谢谢。

解决方案 »

  1.   

    建议你用form提交,效果会好得多
      

  2.   

    使用表单提交
    <A HREF="JAVASCRIPT:goURL('maillist',' ws_flag IN (0)  AND  ws_status IN (0,1)  AND  bene_type IN (0,1)  ')">dfd</A>
    <FORM METHOD=POST ACTION="" name=goForm>
    <INPUT TYPE="hidden" NAME="statement">
    </FORM>
    <SCRIPT LANGUAGE="JavaScript">
    <!--
    function goURL(formAction,formPar)
    {
    document.goForm.formAction = formAction;
    document.goForm.statement.value = formPar;
    document.goForm.submit();
    }
    //-->
    </SCRIPT>:_)
      

  3.   

    呵呵,写错了,笔误
    document.goForm.formAction = formAction;
    ==>
    document.goForm.action = formAction;
    :_)
      

  4.   

    <script>
    strHref="http://****";
    strHref=escape(strHref);
    location.href=strHref;
    </script>
      

  5.   

    请在属性赋值的时候使用双引号<a href="/servlet/maillist?statement=' ws_flag IN (0)  AND  ws_status IN 
    (0,1)  AND  bene_type IN (0,1)  '">导出Email</a>