public static String decode(String escaped) throws URIException {
try {
byte[] rawdata = URLCodec.decodeUrl(EncodingUtil.getAsciiBytes(escaped));
return EncodingUtil.getString(rawdata, URI.getDefaultProtocolCharset());
} catch (DecoderException e) {
throw new URIException(e.getMessage());
}
}