public static boolean isPrintableCharacter(final char c) {
    final Character.UnicodeBlock block = Character.UnicodeBlock.of(c);

    return !Character.isISOControl(c)
        && (c != KeyEvent.CHAR_UNDEFINED)
        && (block != null)
        && (block != Character.UnicodeBlock.SPECIALS);
  }
Tests whether a character is a printable ASCII character.

@param c The character to test.
@return True, if the character is a printable ASCII character. False, otherwise.
java/zylib/src/main/java/com/google/security/zynamics/zylib/general/Convert.java