S
shank
Having trouble decoding. The below function Encodes this...
5031 S. DELPHIA ST. to this...
5031 S%2E DELPHIA ST%2E
No problem.
But when decoded, I get...
5031 S. DELPHIA ST2E
%2E is decoding to 2E at the end
What am I doing wrong?
thanks!
<%
'function for coding links to customer form
' this function also decodes
Function URLDecode(str)
str = Replace(str, "+", " ")
For i = 1 To Len(str)
sT = Mid(str, i, 1)
If sT = "%" Then
If i+2 < Len(str) Then
sR = sR & _
Chr(CLng("&H" & Mid(str, i+1, 2)))
i = i+2
End If
Else
sR = sR & sT
End If
Next
URLDecode = sR
End Function
Function URLEncode(str)
URLEncode = Server.URLEncode(str)
End Function
%>
5031 S. DELPHIA ST. to this...
5031 S%2E DELPHIA ST%2E
No problem.
But when decoded, I get...
5031 S. DELPHIA ST2E
%2E is decoding to 2E at the end
What am I doing wrong?
thanks!
<%
'function for coding links to customer form
' this function also decodes
Function URLDecode(str)
str = Replace(str, "+", " ")
For i = 1 To Len(str)
sT = Mid(str, i, 1)
If sT = "%" Then
If i+2 < Len(str) Then
sR = sR & _
Chr(CLng("&H" & Mid(str, i+1, 2)))
i = i+2
End If
Else
sR = sR & sT
End If
Next
URLDecode = sR
End Function
Function URLEncode(str)
URLEncode = Server.URLEncode(str)
End Function
%>