我找到的:
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();
}大家可以参考一下,谢谢。
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();
}大家可以参考一下,谢谢。
<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>:_)
document.goForm.formAction = formAction;
==>
document.goForm.action = formAction;
:_)
strHref="http://****";
strHref=escape(strHref);
location.href=strHref;
</script>
(0,1) AND bene_type IN (0,1) '">导出Email</a>