List of utility methods to do String Decode by Charset
String | decode(final String str, final Charset charset) decode try { return URLDecoder.decode(str, charset.name()); } catch (UnsupportedEncodingException ex) { throw new AssertionError(charset.name() + " not supported"); |
String | decode(String s, Charset encoding) Decodes an octet according to RFC 2396. if (s == null || s.isEmpty()) { return null; StringBuilder sb = new StringBuilder(); boolean fragment = false; for (int i = 0; i < s.length(); i++) { char ch = s.charAt(i); switch (ch) { ... |
String | decode(String url, Charset charset) decode try { return URLDecoder.decode(url, charset.name()); } catch (UnsupportedEncodingException e) { throw new RuntimeException("Unable to encode using charset"); |
String | decode(String value, Charset charset) Uses URLDecoder to decode a application/x-www-form-urlencoded string, using the given Charset. try { return URLDecoder.decode(value, charset.name()); } catch (UnsupportedEncodingException ex) { throw new IllegalArgumentException("Characterset is not supported."); |
String | decode(String value, Charset charset) Uri Decode the value. try { return URLDecoder.decode(value, charset.name()); } catch (UnsupportedEncodingException uee) { return value; |
String | decodeCharset(String value, String charset) decode Charset try { Charset set = Charset.forName(charset); return set.decode(ByteBuffer.wrap(value.getBytes())).toString(); } catch (Exception ex) { return null; |
String | decodeComponent(final String s, final Charset charset) Decodes a bit of an URL encoded by a browser. if (s == null) { return ""; final int size = s.length(); boolean modified = false; for (int i = 0; i < size; i++) { final char c = s.charAt(i); switch (c) { ... |
String | decodeFormFields(final String content, final Charset charset) decode Form Fields if (content == null) { return null; return urlDecode(content, charset != null ? charset : Charset.forName("UTF-8"), true); |
String | decodeURL(@Nullable String str, Charset charSet) Decodes a application/x-www-form-urlencoded string using a specific encoding scheme.
boolean needToChange = false; int numChars = str.length(); StringBuilder sb = new StringBuilder(numChars > 500 ? numChars / 2 : numChars); int i = 0; char c; byte[] bytes = null; while (i < numChars) { c = str.charAt(i); ... |
String | decodeWithDefaultCharSet(String urlToDecode) decode With Default Char Set try { return URLDecoder.decode(urlToDecode, Charset.defaultCharset().name()); } catch (UnsupportedEncodingException e) { return urlToDecode; |