org.jfree.layouting.util
Class UTFEncodingUtil

java.lang.Object
  extended by org.jfree.layouting.util.UTFEncodingUtil

public class UTFEncodingUtil
extends java.lang.Object

Provides a method to encode any string into a URL-safe form. Non-ASCII characters are first encoded as sequences of two or three bytes, using the UTF-8 algorithm, before being encoded as %HH escapes.

Code is the public example given at http://www.w3.org/International/O-URL-code.html


Method Summary
static java.lang.String decode(java.lang.String s, java.lang.String encoding)
           
static java.lang.String decodeUTF(java.lang.String s)
           
static java.lang.String encode(java.lang.String s)
           
static java.lang.String encode(java.lang.String s, java.lang.String encoding)
           
static java.lang.String encodeUTF8(java.lang.String s)
          Encode a string according to RFC 1738.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

encodeUTF8

public static java.lang.String encodeUTF8(java.lang.String s)
Encode a string according to RFC 1738.

"...Only alphanumerics [0-9a-zA-Z], the special characters "$-_.+!*'()," [not including the quotes - ed], and reserved characters used for their reserved purposes may be used unencoded within a URL."

Parameters:
s - The string to be encoded
Returns:
The encoded string

encode

public static java.lang.String encode(java.lang.String s,
                                      java.lang.String encoding)
                               throws java.io.UnsupportedEncodingException
Throws:
java.io.UnsupportedEncodingException

encode

public static java.lang.String encode(java.lang.String s)
                               throws java.io.UnsupportedEncodingException
Throws:
java.io.UnsupportedEncodingException

decode

public static java.lang.String decode(java.lang.String s,
                                      java.lang.String encoding)
                               throws java.io.UnsupportedEncodingException
Throws:
java.io.UnsupportedEncodingException

decodeUTF

public static java.lang.String decodeUTF(java.lang.String s)