List of utility methods to do Charset Convert
boolean | isCharset(final String str, final String charset, int judgeCharsetLength) is Charset try { String temp = str.length() > judgeCharsetLength ? str .substring(0, judgeCharsetLength) : str; return temp.equals(new String(temp.getBytes(charset), charset)); } catch (Throwable e) { return false; |
String | toCharset(final String str, final String charset, int judgeCharsetLength) to Charset try { String oldCharset = getEncoding(str, judgeCharsetLength); return new String(str.getBytes(oldCharset), charset); } catch (Throwable ex) { LogUtils.w(ex); return str; |
String | changeCharset(String str, String from, String to) change Charset String newStr = null; newStr = new String(str.getBytes(from), to); return newStr; |