This task   (the reverse of   URL encoding   and distinct from   URL parser)   is to provide a function
or mechanism to convert an URL-encoded string into its original unencoded form.



Test cases

   The encoded string   "http%3A%2F%2Ffoo%20bar%2F"   should be reverted to the unencoded form   "http://foo bar/".
   The encoded string   "google.com/search?q=%60Abdu%27l-Bah%C3%A1"   should revert to the unencoded form   "google.com/search?q=`Abdu'l-Bahá".


 
    dim lookUp$( 256)
 
    for i =0 to 256
        lookUp$( i) ="%" +dechex$( i)
    next i
 
    url$ ="http%3A%2F%2Ffoo%20bar%2F"
 
    print "Supplied URL '"; url$; "'"
    print "As string    '"; url2string$( url$); "'"
 
    end
 
function url2string$( i$)
    for j =1 to len( i$)
        c$ =mid$( i$, j, 1)
        if c$ ="%" then
            nc$         =chr$( hexdec( mid$( i$, j +1, 2)))
            url2string$ =url2string$ +nc$ 
            j =j +2
        else
            url2string$ =url2string$ +c$
        end if
    next j
end function
 