List of utility methods to do UTF8 Encode
String | encodeSignatureUtf8(byte[] sig) Encodes the signature using charset UTF-8. return new String(sig, SIGNATURE_CHARSET); |
String | encodeStringUtf8(String text) encode String Utf return new String(Charset.forName("UTF-8").encode(text).array()); |
String | encodeToUTF8(String str) encode To UTF return encode(str, StandardCharsets.UTF_8.name());
|
String | encodeUtf8(byte[] bytes) encode Utf try { return bytes == null ? null : new String(bytes, UTF8); } catch (UnsupportedEncodingException e) { throw new RuntimeException("Could not convert bytes to UTF-8 string", e); |
String | encodeUTF8(byte[] bytes) encode UTF return new String(bytes, CHARSET_UTF8); |
byte[] | encodeUTF8(String str) Encode a string as UTF-8. return str.getBytes(utf8Charset);
|
byte[] | encodeUTF8(String str) Convenience method for encoding a UTF-8 byte string from a Java String . try { return str.getBytes("UTF-8"); } catch (UnsupportedEncodingException e) { throw new RuntimeException("UTF-8 charset not found! This should not happen...", e); |
byte[] | encodeUtf8(String string) encode Utf if (string == null) return null; return string.getBytes(CharsetUTF8); |
String | encodeUtf8(String target) encode Utf String result = null; try { result = new String(target.getBytes(), "UTF-8"); } catch (UnsupportedEncodingException e) { System.err.println("ERROR! encode utf8 failed - " + e); return result; |
byte[] | encodeUTF8(String text) encode UTF try { return text.getBytes(UTF_8.name()); } catch (UnsupportedEncodingException e) { throw new AssertionError(e); |