January 1, 2005

WinTask - URLUnescape

'
' UrlUnescape - Converts escape sequences back into ordinary characters.
'

' Author: Joe Strazzere

'

 

Dim OldURL as unsigned
Dim NewURL as unsigned
Dim count as unsigned
Dim flags as unsigned

 

OldURL=Allocate(100)
NewURL=Allocate(100)
Count=Allocate(100)
Flags=Allocate(100)

 

PokeString(OldURL,"http://www.zerble.com/arg=A%20B%20C",1)
'PokeString(OldURL,"This is a test",1)
PokeString(NewURL,"                                                                                                    ",1)
PokeInteger(Count,100,4)  ' the intial length of NewURL goes here, the new length is returned here
PokeInteger(Flags,0,4)

 

ret=External("shlwapi.dll","UrlUnescapeA",OldURL,NewURL, count, flags)
msgbox(ret)

 

ret=PeekInteger(count,4)
NewURL$=PeekString$(NewURL)
msgbox(Str$(ret)+" characters ="+NewURL$)