Function UrlEncoder(sUrl As String) As String Export
	Dim sRetStr As String
	For i As Integer = 0 To Len(sUrl)-1
		Select case sUrl[i] 
			Case 45 To 58,65 To 90,97 To 122,95
				sRetStr &= Chr(sUrl[i])
			Case Else
				sRetStr &= "%" & Hex(sUrl[i])			
		End Select
	Next
	Return sRetStr
End Function

Function UrlDecoder(sUrl As String) As String Export
	Dim As String sRetStr, sTemp
	For i As Integer = 1 To Len(sUrl)
		sTemp = Mid(sUrl,i,1)
		Select case sTemp 
			Case "%"
				sTemp =  "&h" & Mid(sUrl,i+1,2)
				sRetStr &= Chr(Val(sTemp))
				i+=2
			Case Else
				sRetStr &= sTemp			
		End Select
	Next
	Return sRetStr
End Function

