List of utility methods to do String Encode
String | encodeUTF8(String s) string encoding is centralized at this method if (s != null) { s = URLEncoder.encode(s, "UTF-8"); return s; |
String | encodeUTF8(String s) encode UTF try { if (s == null || s.equals("")) return ""; s = URLEncoder.encode(s, "UTF-8"); s = s.replaceAll("\\+", "%20"); return s; } catch (Exception e) { e.printStackTrace(); ... |
String | encodeValue(String dirtyValue) Helper function for character encoding String cleanValue = ""; try { cleanValue = URLEncoder.encode(dirtyValue, "UTF-8").replace("+", "%20"); } catch (UnsupportedEncodingException e) { e.printStackTrace(); return cleanValue; |
String | encodeValue(String str) Encode a string value to URL encoding standards try { return URLEncoder.encode(str, "UTF-8"); } catch (Exception e) { return str; |
String | encodeValue(String value) encode Value try { return URLEncoder.encode(value, "UTF-8").replaceAll("\\+", "%20").replaceAll("\\%21", "!") .replaceAll("\\%27", "'") .replaceAll("\\%28", "(").replaceAll("\\%29", ")").replaceAll("\\%7E", "~"); } catch (UnsupportedEncodingException e) { return value.replaceAll(" ", "%20").replaceAll("\\%21", "!").replaceAll("\\%27", "'") .replaceAll("\\%28", "(") .replaceAll("\\%29", ")").replaceAll("\\%7E", "~"); ... |