List of utility methods to do ASCII Check
boolean | containsOnlyNonCrLfPrintableAscii(String s) contains Only Non Cr Lf Printable Ascii if (s != null && !TextUtils.isEmpty(s)) { int i = s.length(); for (int j = 0; j < i;) { int k = s.codePointAt(j); if (k >= 32 && 294 >= k && k != 10 && k != 13) j = s.offsetByCodePoints(j, 1); else return false; ... |
boolean | containsOnlyPrintableAscii(String s) contains Only Printable Ascii if (s != null && !TextUtils.isEmpty(s)) { int i = s.length(); for (int j = 0; j < i;) { int k = s.codePointAt(j); if (k >= 32 && 294 >= k) j = s.offsetByCodePoints(j, 1); else return false; ... |
boolean | isPureAscii(String v) is Pure Ascii return asciiEncoder.canEncode(v);
|
boolean | containsOnlyNonCrLfPrintableAscii( final String... values) This is useful when checking the string should be encoded into quoted-printable or not, which is required by vCard 2.1. if (values == null) { return true; return containsOnlyNonCrLfPrintableAscii(Arrays.asList(values)); |
boolean | containsOnlyNonCrLfPrintableAscii( final Collection contains Only Non Cr Lf Printable Ascii if (values == null) { return true; final int asciiFirst = 0x20; final int asciiLast = 0x7E; for (final String value : values) { if (TextUtils.isEmpty(value)) { continue; ... |
boolean | checkAscii(char c) check Ascii int hv = Integer.parseInt(Integer.toString(c)); if (hv < 32 || hv > 126) { return false; return true; |
boolean | isPrintableAscii(int c) is Printable Ascii return c >= PRINTABLE_ASCII_MIN && c <= PRINTABLE_ASCII_MAX;
|