if (CharsetUtil.isAsciiSuperset(charset)) { // Run a more in-depth check to make sure // Encoding Unicode 128 onwards should never generate bytes 0 to 127.
CharsetEncoder encoder = charset.newEncoder();
CharBuffer inChars = CharBuffer.allocate(8);
ByteBuffer outBytes;
for (int i = 128; i < Character.MAX_CODE_POINT; i++) {
inChars.clear(); char[] chars = Character.toChars(i); for (char c : chars) {
inChars.append(c);
}
inChars.flip(); try {
outBytes = encoder.encode(inChars);
} catch (CharacterCodingException e) { // Ignore. The encoding can't handle the codepoint. That is fine. continue;
}
outBytes.flip(); while (outBytes.hasRemaining()) { byte b = outBytes.get(); // All bytes should have the highest bit set if ((b & 0x80) == 0) { Assert.fail("[" + charset.name() + " is not a superset of ASCII");
}
}
}
} else {
System.out.println("Not: " + charset.name());
}
}
}
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.10 Sekunden
(vorverarbeitet am 2026-09-29)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.