StringUtil { public static boolean isAscii(@NonNull String text) { Objects.requireNonNull(text, "text is null"); return StandardCharsets.US_ASCII.newEncoder().canEncode(text); }  static boolean isAscii(@NonNull String text);  }
@Test public void asciiTest() { assertFalse(StringUtil.isAscii("Réal")); assertTrue(StringUtil.isAscii("Real")); }