public class EncodingUtil
extends java.lang.Object
http://stackoverflow.com/questions/607176/java-equivalent-to-javascripts-encodeuricomponent-that-produces-identical-output
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
decodeURIComponent(java.lang.String s)
Decodes the passed UTF-8 String using an algorithm that's compatible with
JavaScript's
decodeURIComponent function. |
static java.lang.String |
encodeURIComponent(java.lang.String s)
Encodes the passed String as UTF-8 using an algorithm that's compatible
with JavaScript's
encodeURIComponent function. |
public static java.lang.String decodeURIComponent(java.lang.String s)
decodeURIComponent
function. Returns
null
if the String is null
.s
- The UTF-8 encoded String to be decoded.public static java.lang.String encodeURIComponent(java.lang.String s)
encodeURIComponent
function. Returns
null
if the String is null
.s
- The String to be encoded