WebCommon.urlEncode3kaya
Url encode a string
Usage
String urlEncode( String x )
Arguments
x The string to encode
Overview
URL encode a string. You should use this to encode reserved characters in URLs that you wish to be passed literally.
-
// trying to pass "http://www.example.com" as a parameter
url = "http://localhost/test.cgi?url=";
url += urlEncode("http://www.example.com");
// url = http://localhost/test.cgi?url=http%3A%2F%2Fwww.example.com
Note that in the example above, encoding the whole URL would be incorrect - that would create a relative URL beginning "http://".
Releases
4 releases since Debian 5.0 (Lenny); the text changed 3 times.