URL encoding: Difference between revisions

m
Replace deprecated functions
m (→‎{{header|Wren}}: Minor tidy)
m (Replace deprecated functions)
Line 1,737:
works like ''toPercentEncoded'' and additionally encodes a space with '+'.
Both functions work for byte sequences (characters beyond '\255\' raise the exception RANGE_ERROR).
To encode Unicode characters it is necessary to convert them to UTF-8 with ''striToUtf8'' before[https://seed7.<syntaxhighlightsourceforge.net/libraries/unicode.htm#toUtf8(in_string) lang="seed7">$toUtf8] include "seed7_05before.s7i";
<syntaxhighlight lang="seed7">$ include "seed7_05.s7i";
include "encoding.s7i";
 
Line 1,744 ⟶ 1,745:
writeln(toPercentEncoded("http://foo bar/"));
writeln(toUrlEncoded("http://foo bar/"));
end func;</syntaxhighlight>{{out}}
{{out}}
http%3A%2F%2Ffoo%20bar%2F
http%3A%2F%2Ffoo+bar%2F
29

edits