diff --git a/src/core/tools/qchar.cpp b/src/core/tools/qchar.cpp index ad2af9126..1cc147808 100644 --- a/src/core/tools/qchar.cpp +++ b/src/core/tools/qchar.cpp @@ -612,6 +612,16 @@ bool QChar::isSpace() const { if(ucs >= 9 && ucs <= 13) return true; + const int8_t category = u_charType(ucs); + switch (category) { + case U_SPACE_SEPARATOR: + case U_LINE_SEPARATOR: + case U_PARAGRAPH_SEPARATOR: + return true; + default: + return false; + } + // special characters check return u_isblank(ucs); } @@ -676,7 +686,21 @@ bool QChar::isLetterOrNumber() const if (is_ascii_char(ucs)) { return is_ascii_letterornumber(ucs); } - return u_isalnum(ucs); + const int8_t category = u_charType(ucs); + switch (category) { + case U_UPPERCASE_LETTER: + case U_LOWERCASE_LETTER: + case U_TITLECASE_LETTER: + case U_MODIFIER_LETTER: + case U_OTHER_LETTER: + case U_DECIMAL_DIGIT_NUMBER: + case U_LETTER_NUMBER: + case U_OTHER_NUMBER: + return true; + default: + return false; + } + return false; }