| java.lang.Object org.apache.tomcat.util.buf.UEncoder
UEncoder | final public class UEncoder (Code) | | Efficient implementation for encoders.
This class is not thread safe - you need one encoder per thread.
The encoder will save and recycle the internal objects, avoiding
garbage.
You can add extra characters that you want preserved, for example
while encoding a URL you can add "/".
author: Costin Manolache |
UEncoder | public UEncoder()(Code) | | |
addSafeCharacter | public void addSafeCharacter(char c)(Code) | | |
encodeURL | public String encodeURL(String uri)(Code) | | Utility funtion to re-encode the URL.
Still has problems with charset, since UEncoder mostly
ignores it.
|
urlEncode | public void urlEncode(Writer buf, String s) throws IOException(Code) | | URL Encode string, using a specified encoding.
Parameters: s - string to be encoded Parameters: enc - character encoding, for chars >%80 ( use UTF8 if not set,as recommended in RFCs) Parameters: reserved - extra characters to preserve ( "/" - if s is a URL ) |
|
|