com.paypal.base.util
Class PayPalURLEncoder

java.lang.Object
  extended by com.paypal.base.util.PayPalURLEncoder

public final class PayPalURLEncoder
extends Object


Method Summary
static String encode(String s, String enc)
          Encodes the given string s in a x-www-form-urlencoded string using the specified encoding scheme enc.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

encode

public static String encode(String s,
                            String enc)
                     throws UnsupportedEncodingException
Encodes the given string s in a x-www-form-urlencoded string using the specified encoding scheme enc.

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 encoded.
enc - the encoding scheme to be used.
Returns:
the encoded string.
Throws:
UnsupportedEncodingException


Copyright © 2015. All Rights Reserved.