简体   繁体   中英

non printable characters in java

Please, can you give me a list of non printable characters in java programming? Thank you in advance.

Java uses the Unicode standard, so you should be asking about non-printable (non-printing?) characters in Unicode.

http://en.wikipedia.org/wiki/Unicode_control_characters

Java strings are unicode strings. Unicode doesn't have a concept of "non-printable" characters, exactly, but the ASCII non-printable range, along with several other characters, are considered Unicode control characters .

Are spaces printable? What about the private use area? Please modify the code to your definition of "printable" :)

import static java.lang.Character.*;

for (int i=0; i<MAX_CODE_POINT; i++) {
    int t = getType(i);
    boolean p = t == CONTROL || t == CONNECTOR_PUNCTUATION || t == CURRENCY_SYMBOL || t == DASH_PUNCTUATION || t == DECIMAL_DIGIT_NUMBER || t == ENCLOSING_MARK || t == END_PUNCTUATION || t == FINAL_QUOTE_PUNCTUATION || t == INITIAL_QUOTE_PUNCTUATION || t == LETTER_NUMBER || t == LOWERCASE_LETTER || t == MATH_SYMBOL || t == MODIFIER_LETTER || t == MODIFIER_SYMBOL || t == OTHER_LETTER || t == OTHER_NUMBER || t == OTHER_PUNCTUATION || t == OTHER_SYMBOL || t == START_PUNCTUATION || t == TITLECASE_LETTER || t == UPPERCASE_LETTER;
    if (!p) {
        System.out.println("Non printable codepoint " + i);
    }
}        

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM