I want to write the two functions that is used for asp.net and asp. I want to write two version. This function is used url encode and decode. Now, I got a new problem. This is how to work server.urlencode. So, how to implement this url encode function. I have url decode function for asp. I try to get url encode function for asp. So that, I can write url encode and decode in asp.net. Please, help me.
This is url decode function.
Function URLDecode(sConvert)
Dim aSplit
Dim sOutput
Dim I
If IsNull(sConvert) Then
URLDecode = ""
Exit Function
End If
' convert all pluses to spaces
sOutput = REPLACE(sConvert, "+", " ")
' next convert %hexdigits to the character
aSplit = Split(sOutput, "%")
If IsArray(aSplit) Then
sOutput = aSplit(0)
For I = 0 to UBound(aSplit) - 1
sOutput = sOutput & _
Chr("&H" & Left(aSplit(i + 1), 2)) &_
Right(aSplit(i + 1), Len(aSplit(i + 1)) - 2)
Next
End If
URLDecode = sOutput
End Function
I got this.