Private Sub Form_Load()
Dim MyString As String
MyString = "%22Jomenvisst+s%F6rru%2C+det+h%E4r+funka+ju+r%E4tt+s%E5+bra+he+he+%3A-)%22"
MyString = UrlDecode(MyString)
MsgBox "[" & MyString & "]"
End Sub
Private Function UrlDecode(ByVal str As String) As String
Dim bufString As String
Dim n As Long
Dim c As String
Dim skipped As Long
Dim hexChr As String
bufString = Space$(Len(str))
Do
n = n + 1
c = Mid$(str, n, 1)
Select Case c
Case "a" To "z", "A" To "Z", "0" To "9", "-", "_", ".", "!", "~", "*", "'", "(", ")"
Mid$(bufString, n + skipped, 1) = c
Case "+"
Mid$(bufString, n + skipped, 1) = " "
Case "%"
hexChr = Mid$(str, n + 1, 2)
Mid$(bufString, n + skipped, 1) = Chr(CLng("&H" & hexChr))
n = n + 2
skipped = skipped - 2
End Select
Loop Until Len(c) = 0
UrlDecode = Left$(bufString, n + skipped - 1)
End Function