URLEncoderNameURLEncoderSynopsis
DescriptionThe URLEncoder class defines a single static method that converts a String to its URL-encoded form. More precisely, the String is converted to a MIME type called x-www-form-urlencoded. This is the format used when posting forms on the Web. The algorithm leaves letters, numbers, and the dash (-), underscore ( _ ), period (.), and asterisk (*) characters unchanged. Space characters are converted to plus signs (+). All other characters are encoded with a percent sign (%) followed by the character code represented as a two-digit hexadecimal number. For example, consider the following string:
Jean-Louis Gassée This string gets encoded as:
Jean-Louis+Gas%8ee The point of the URLEncoder class is to provide a way to canonicalize a string into an extremely portable subset of ASCII that can be handled properly by computers around the world. Class Summary
public class java.net.URLEncoder extends java.lang.Object { // Class Methods public static String encode(String s); } Class Methodsencodepublic static String encode(String s)
Inherited Methods
See AlsoString, URL |
|