org.xhtmlrenderer.simple.extend
Class URLUTF8Encoder

java.lang.Object
  extended by org.xhtmlrenderer.simple.extend.URLUTF8Encoder

public class URLUTF8Encoder
extends 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.

Author:
Torbjoern Gannholm

Constructor Summary
URLUTF8Encoder()
           
 
Method Summary
static String encode(char[] chars)
          Description of the Method
static String encode(String s)
          Encode a string to the "x-www-form-urlencoded" form, enhanced with the UTF-8-in-URL proposal.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

URLUTF8Encoder

public URLUTF8Encoder()
Method Detail

encode

public static String encode(String s)
Encode a string to the "x-www-form-urlencoded" form, enhanced with the UTF-8-in-URL proposal. This is what happens:

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

encode

public static String encode(char[] chars)
Description of the Method

Parameters:
chars - PARAM
Returns:
Returns


Copyright © 2013. All Rights Reserved.