java.net
public class URLEncoder extends Object
This method is very useful for encoding strings to be sent to CGI scripts
public static String encode(String s)
s
- The String to convertpublic static String encode(String s, String encoding) throws UnsupportedEncodingException
s
- The String to convertencoding
- The encoding to use for unsafe charactersUnsupportedEncodingException
- If the named encoding is not
supported