Android
java.net
public class

java.net.URLEncoder

java.lang.Object
java.net.URLEncoder

This class is used to encode a string using the format required by application/x-www-form-urlencoded MIME content type.

Summary

Public Methods

      static    String  encode(String s, String enc)
This class contains a utility method for converting a string to the format required by the application/x-www-form-urlencoded MIME content type.
      static    String  encode(String s)
This method is deprecated. use encode(String, String) instead
Methods inherited from class java.lang.Object

Details

Public Methods

public static String encode(String s, String enc)

This class contains a utility method for converting a string to the format required by the application/x-www-form-urlencoded MIME content type. All characters except letters ('a'..'z', 'A'..'Z') and numbers ('0'..'9') and characters '.', '-', '*', '_' are converted into their hexadecimal value prepended by '%'. For example: '#' -> %23 In addition, spaces are substituted by '+'

Parameters

s the string to be converted

Returns

  • the converted string

public static String encode(String s)

This method is deprecated. use encode(String, String) instead

This class contains a utility method for converting a string to the format required by the application/x-www-form-urlencoded MIME content type.

All characters except letters ('a'..'z', 'A'..'Z') and numbers ('0'..'9') and characters '.', '-', '*', '_' are converted into their hexidecimal value prepended by '%'.

For example: '#' -> %23

In addition, spaces are substituted by '+'

Parameters

s java.lang.String the converted string

Returns

  • java.lang.String the string to be converted
Copyright 2007 Google Inc. Build 0.9_r1-98467 - 14 Aug 2008 18:56