The list of methods to do UTF8 From are organized into topic(s).
byte[]
getUTF8(String data) get UTF
try {
return data.getBytes("UTF-8");
} catch (UnsupportedEncodingException e) {
return null;
String
getUTF8(String s) get UTF
if (s == null || s.equals("")) {
return "";
String ss = "";
try {
ss = new String(s.getBytes("ISO-8859-1"), "UTF-8");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
...
byte[]
getUTF8(String string) Encodes a string as an array of UTF-8 bytes.
try {
return string.getBytes("UTF-8");
} catch (UnsupportedEncodingException ex) {
throw new AssertionError(ex);
byte[]
getUtf8Bytes(String s) get Utf Bytes
try {
return s.getBytes("UTF-8");
} catch (UnsupportedEncodingException e) {
throw new RuntimeException("UTF-8 not found.", e);
byte[]
getUTF8Bytes(String str) get UTF Bytes
byte[] bytes = null;
try {
bytes = str.getBytes("UTF-8");
} catch (UnsupportedEncodingException e) {
logger.log(Level.WARNING, "UTF-8 decoding error, continue by using default instead", e);
bytes = str.getBytes();
return bytes;
...