URL decoding: Difference between revisions

Content added Content deleted
Line 945: Line 945:
=={{header|langur}}==
=={{header|langur}}==
<syntaxhighlight lang="langur">val .finish = f(.s) b2s map f number(.x, 16), rest split "%", .s
<syntaxhighlight lang="langur">val .finish = f(.s) b2s map f number(.x, 16), rest split "%", .s
val .decode = f(.s) replace .s, re/(%[0-9A-Fa-f]{2})+/, .helper
val .decode = f(.s) replace .s, re/(%[0-9A-Fa-f]{2})+/, .finish


writeln .decode("http%3A%2F%2Ffoo%20bar%2F")
writeln .decode("http%3A%2F%2Ffoo%20bar%2F")