List of utility methods to do UTF Check
String | getUTFFormat(int p_type) Get corresponding UTF type string according with its type value if (p_type < 0 || p_type >= UTF_FORMATS.size()) return null; else return UTF_FORMATS.get(p_type); |
boolean | isUTFFormat(String p_format) Verify if the format is an UTF format if (StringUtil.isEmpty(p_format)) return false; return UTF_FORMATS.contains(p_format); |
boolean | isUTF8(String encoding) Whether a given encoding - or the platform's default encoding if the parameter is null - is UTF-8. if (encoding == null) { encoding = System.getProperty("file.encoding"); return UTF8.equalsIgnoreCase(encoding) || UTF_DASH_8.equalsIgnoreCase(encoding); |
int | utf8Length(byte[] buffer, int str, int len) utf Length final int last = str + len; int counter = 0; while (str < last) { final int bt = buffer[str]; if ((bt & 0x80) == 0) { ++str; } else if ((bt & 0x20) == 0) { str += 2; ... |