question: 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 ; }
target:  Tries to decode specified text (also trying to autodetect encoding). If something gone wrong -- returns source text.