Function URLEncode(strURL)
Dim I
Dim tempStr
For I = 1 ToLen(strURL)
IfAsc(Mid(strURL, I, 1)) < 0 Then
tempStr ="%"&Right(CStr(Hex(Asc(Mid(strURL, I, 1)))), 2)
tempStr ="%"&Left(CStr(Hex(Asc(Mid(strURL, I, 1)))), Len(CStr(Hex(Asc(Mid(strURL, I, 1))))) - 2) & tempStr
URLEncode = URLEncode & tempStr
ElseIf (Asc(Mid(strURL, I, 1)) >= 65 AndAsc(Mid(strURL, I, 1)) <= 90) Or (Asc(Mid(strURL, I, 1)) >= 97 AndAsc(Mid(strURL, I, 1)) <= 122) Or (Asc(Mid(strURL, I, 1)) >= 48 AndAsc(Mid(strURL, I, 1)) <= 57) Then
URLEncode = URLEncode &Mid(strURL, I, 1)
Else
URLEncode = URLEncode &"%"&Hex(Asc(Mid(strURL, I, 1)))
EndIfNextEndFunctionFunction URLDecode(strURL)
Dim I
IfInStr(strURL, "%") = 0 Then
URLDecode = strURL
ExitFunctionEndIfFor I = 1 ToLen(strURL)
IfMid(strURL, I, 1) ="%"ThenIfEval("&H"&Mid(strURL, I + 1, 2)) > 127 Then
URLDecode = URLDecode &Chr(Eval("&H"&Mid(strURL, I + 1, 2) &Mid(strURL, I + 4, 2)))
I = I + 5
Else
URLDecode = URLDecode &Chr(Eval("&H"&Mid(strURL, I + 1, 2)))
I = I + 2
EndIfElse
URLDecode = URLDecode &Mid(strURL, I, 1)
EndIfNextEndFunction