
Use the new URLEncoder.encode() method from Java 1.4 if available, else
use the old deprecated version. This method uses reflection to find
the appropriate method; if the reflection operations throw exceptions,
this will return the url encoded with the old URLEncoder.encode()
method.
Returns:
String The encoded url.
Parameters:
-
enc - The character encoding the urlencode is performed on.