URL encoding: Difference between revisions

(→‎{{header|Vlang}}: Rename "Vlang" in "V (Vlang)")
Line 902:
)
 
valwriteln .original = urlEncode("https://some website.com/")</syntaxhighlight>
 
writeln .original
writeln .urlEncode(.original)</syntaxhighlight>
 
This should work with non-ASCII characters as well (assuming that's valid).
 
We pass a custom anonymous function to replace(), which uses the the s2b() function (returning UTF-8 bytes from a string), and a for loop adding them all.
885

edits