1%26b%3D%CE%D2%CA%C7%CB%AD<script language="vbscript"> function urlencoding(vstrin) dim i,strreturn strreturn = "" for i = 1 to len(vstrin) thischr = mid(vstrin,i,1) if abs(asc(thischr)) < &hff then 'Yang if thischr="+" or thischr=" " or thischr="&" or thischr="=" then strreturn = strreturn & "%" & hex(asc(thischr)) else strreturn = strreturn & thischr end if 'End else innercode = asc(thischr) if innercode < 0 then innercode = innercode + &h10000 end if hight8 = (innercode and &hff00)\ &hff low8 = innercode and &hff strreturn = strreturn & "%" & hex(hight8) & "%" & hex(low8) end if next urlencoding = strreturn end function </script> <script language="javascript"> alert(urlencoding("1&b=我是谁")) </script>
1%26b%3D%CE%D2%CA%C7%CB%AD<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
</head><body>
<form method=get >
<input name=a>
<input type=submit value=确定>
</form>
</html>
function urlencoding(vstrin)
dim i,strreturn
strreturn = ""
for i = 1 to len(vstrin)
thischr = mid(vstrin,i,1)
if abs(asc(thischr)) < &hff then
'Yang
if thischr="+" or thischr=" " or thischr="&" or thischr="=" then
strreturn = strreturn & "%" & hex(asc(thischr))
else
strreturn = strreturn & thischr
end if
'End
else
innercode = asc(thischr)
if innercode < 0 then
innercode = innercode + &h10000
end if
hight8 = (innercode and &hff00)\ &hff
low8 = innercode and &hff
strreturn = strreturn & "%" & hex(hight8) & "%" & hex(low8)
end if
next
urlencoding = strreturn
end function
</script>
<script language="javascript">
alert(urlencoding("1&b=我是谁"))
</script>