qb64-include/urldecode.bm

19 lines
561 B
Text
Raw Normal View History

2022-09-19 01:27:48 +02:00
$if urldecode = undefined then
$let urldecode = defined
2022-05-21 08:20:05 +02:00
Function urldecode$ (strng As String)
Dim Tmpstr As String
Do Until count >= Len(strng)
count = count + 1
Select Case Mid$(strng, count, 1)
Case "%"
Tmpstr = Tmpstr + Chr$(Val("&H" + Mid$(strng, count + 1, 2)))
count = count + 2
Case "+"
Tmpstr = Tmpstr + " "
Case Else
Tmpstr = Tmpstr + Mid$(strng, count, 1)
End Select
Loop
urldecode = Tmpstr
End Function
2022-09-19 01:27:48 +02:00
$end if