pnuts.servlet
Class URLEncoding

java.lang.Object
  |
  +--pnuts.servlet.URLEncoding

public class URLEncoding
extends java.lang.Object

A set of utility methods which are related to character encoding.


Constructor Summary
protected URLEncoding()
           
 
Method Summary
static java.lang.String decode(java.lang.String s, java.lang.String enc)
          Decodes a x-www-form-urlencoded to a String.
static java.lang.String encode(java.lang.String s, java.lang.String enc)
          Translates a string into x-www-form-urlencoded format.
static java.util.Hashtable parseQueryString(java.lang.String s, java.lang.String enc)
          Parses a QUERY_STRING passed from the client to the server and build a Hashtable with key-value pairs.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

URLEncoding

protected URLEncoding()
Method Detail

encode

public static java.lang.String encode(java.lang.String s,
                                      java.lang.String enc)
                               throws java.io.UnsupportedEncodingException
Translates a string into x-www-form-urlencoded format.
Parameters:
s - The input data to be encoded
enc - The character encoding

decode

public static java.lang.String decode(java.lang.String s,
                                      java.lang.String enc)
                               throws java.io.UnsupportedEncodingException
Decodes a x-www-form-urlencoded to a String.
Parameters:
s - The encoded data to be decoded
enc - The character encoding

parseQueryString

public static java.util.Hashtable parseQueryString(java.lang.String s,
                                                   java.lang.String enc)
                                            throws java.io.UnsupportedEncodingException
Parses a QUERY_STRING passed from the client to the server and build a Hashtable with key-value pairs.
Parameters:
s - "QUERY_STRING"
enc - The character encoding
See Also:
javax.servlet.http.HttpUtils#parseQueryString(java.lang.String)