MCPcopy Create free account
hub / github.com/M66B/FairEmail / isUTF8

Method isUTF8

app/src/main/java/eu/faircode/email/CharsetHelper.java:73–77  ·  view source on GitHub ↗
(String text)

Source from the content-addressed store, hash-verified

71 private static native DetectResult jni_detect_charset(byte[] octets, String ref, String lang);
72
73 static boolean isUTF8(String text) {
74 // Get extended ASCII characters
75 byte[] octets = text.getBytes(StandardCharsets.ISO_8859_1);
76 return isUTF8(octets);
77 }
78
79 static boolean isUTF8(byte[] octets) {
80 return isValid(octets, StandardCharsets.UTF_8);

Callers 3

fixEncodingMethod · 0.95
getHtmlMethod · 0.95
getStructureMethod · 0.95

Calls 2

isValidMethod · 0.95
getBytesMethod · 0.45

Tested by

no test coverage detected