Android Utililty Methods UTF Check

List of utility methods to do UTF Check

Description

The list of methods to do UTF Check are organized into topic(s).

Method

StringgetUTFFormat(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);
booleanisUTFFormat(String p_format)
Verify if the format is an UTF format
if (StringUtil.isEmpty(p_format))
    return false;
return UTF_FORMATS.contains(p_format);
booleanisUTF8(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);
intutf8Length(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;
...