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á".


F url_decode(s)
   V r = ‘’
   V i = 0
   L i < s.len
      I s[i] == ‘%’
         [Byte] b
         L i < s.len & s[i] == ‘%’
            i++
            b.append(Int(s[i.+2], radix' 16))
            i += 2
         r ‘’= b.decode(‘utf-8’)
      E
         r ‘’= s[i]
         i++
   R r
 
print(url_decode(‘http%3A%2F%2Ffoo%20bar%2F’))
print(url_decode(‘https://ru.wikipedia.org/wiki/%D0%A2%D1%80%D0%B0%D0%BD%D1%81%D0%BF%D0%B0%D0%B9%D0%BB%D0%B5%D1%80’))