org.apache.commons.httpclient.util
Class EncodingUtil

java.lang.Object
  |
  +--org.apache.commons.httpclient.util.EncodingUtil

public class EncodingUtil
extends Object

The home for utility methods that handle various encoding tasks.

Since:
2.0 final
Author:
Michael Becke

Method Summary
(package private) static void ()
           
static String formUrlEncode(NameValuePair[] pairs, String charset)
          Form-urlencoding routine.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

static void ()

formUrlEncode

public static String formUrlEncode(NameValuePair[] pairs,
                                   String charset)
Form-urlencoding routine. The default encoding for all forms is `application/x-www-form-urlencoded'. A form data set is represented in this media type as follows: The form field names and values are escaped: space characters are replaced by `+', and then reserved characters are escaped as per [URL]; that is, non-alphanumeric characters are replaced by `%HH', a percent sign and two hexadecimal digits representing the ASCII code of the character. Line breaks, as in multi-line text field values, are represented as CR LF pairs, i.e. `%0D%0A'.
Parameters:
pairs - the values to be encoded
charset - the character set of pairs to be encoded
Returns:
the urlencoded pairs
Since:
2.0 final


Copyright © 2001-2004 Apache Software Foundation. All Rights Reserved.