All About Class URLEncode in Java

Share and Enjoy !

Class URLEncode in Java
Class URLEncode in Java

URLEncode class contains an utility method for converting a String into a MIME format called “x-www-form-urlencoded” format.To convert a String,each character is examined in turn for the following cases..

  • The ASCII characters ‘a’ through ‘z’ ,’A’ through ‘Z’ and ‘0’ through ‘9’ remain the same.
  • The space character ‘ ‘ is converted into a plus sign(+).
  • All other characters are converted into three character String “%xy” where xy is the two digit hexadecimal representation of the lower 16 bit of the character.

The structure of the URLEncode class is given as:

public class extends java.lang.Object{
public static String encode(String str);
//translate a String str into x-www-form-urlencoded format

Share and Enjoy !

See also  Class SecurityManager in Java

Leave a Reply

Your email address will not be published. Required fields are marked *