URL decoding: Difference between revisions

 
(5 intermediate revisions by 3 users not shown)
Line 944:
 
=={{header|langur}}==
<syntaxhighlight lang="langur">val .helperfinish = ffn(.s) { b2s map ffn(.x) { toNumbernumber(.x, 16) }, rest split "%", .s }
val .decode = ffn(.s) { replace .s, re/(%[0-9A-Fa-f]{2})+/, .helperfinish }
 
writeln .decode("http%3A%2F%2Ffoo%20bar%2F")
Line 1,686:
works like ''fromPercentEncoded'' and additionally decodes '+' with a space.
Both functions return byte sequences.
To decode Unicode characters it is necessary to convert them from UTF-8 with ''utf8ToStri''[https://seed7.sourceforge.net/libraries/unicode.htm#fromUtf8(in_string) fromUtf8] afterwards.
<syntaxhighlight lang="seed7">$ include "seed7_05.s7i";
include "encoding.s7i";
Line 1,905:
=={{header|Wren}}==
{{libheader|Wren-fmt}}
<syntaxhighlight lang="ecmascriptwren">import "./fmt" for Conv
 
var urlDecode = Fn.new { |enc|
890

edits