public static String urlDecode(String text){
  if (StringUtils.isEmpty(text)) {
    return text;
  }
  try {
    if (text.contains("%8")) {
      return URLDecoder.decode(text,"UTF-8");
    }
    return URLDecoder.decode(text,"ascii");
  }
 catch (  Exception ex) {
    LOG.warn("Error decoding " + text,ex);
  }
  return text;
}

public static String urlDecode ( String text ) { if ( StringUtils . isEmpty ( text ) ) { return text ; } try { if ( text . contains ( "%8" ) ) { return URLDecoder . decode ( text , "UTF-8" ) ; } return URLDecoder . decode ( text , "ascii" ) ; } catch ( Exception ex ) { LOG . warn ( "Error decoding " + text , ex ) ; } return text ; }
tries to decode specified text ( also trying to autodetect encoding ) . if something gone wrong - - returns source text .
