'---------------------------------------------------------------------- ' ' Unescape() - Convert HTTP-escaped string to normal form ' '---------------------------------------------------------------------- Public Function Unescape(s As String) Dim i As Integer, l As Integer Dim c As String If InStr(s, "%") = 0 Then ' Catch simple case Unescape = s Exit Function End If l = Len(s) Unescape = "" For i = 1 To l c = Mid$(s, i, 1) ' Next character If c = "%" Then If Mid$(s, i + 1, 1) = "%" Then c = "%" i = i + 1 ' Loop increments too Else c = x2c(Mid$(s, i + 1, 2)) i = i + 2 ' Loop increments too End If End If Unescape = Unescape & c Next i End Function