From ba300f42bdbf1e033616ee8a8054d84613b55aca Mon Sep 17 00:00:00 2001 From: Konstantin Ritt Date: Tue, 15 May 2012 20:48:20 +0300 Subject: QChar: add isSurrogate() and isNonCharacter() to the public API + QChar::LastValidCodePoint enum value that supercede the UNICODE_LAST_CODEPOINT macro replace uses of hardcoded values with the new API; remove leftovers Change-Id: I1395c9840b85fcb6b08e241b131794a98773c952 Reviewed-by: Thiago Macieira --- src/corelib/json/qjsonparser.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/corelib/json/qjsonparser.cpp') diff --git a/src/corelib/json/qjsonparser.cpp b/src/corelib/json/qjsonparser.cpp index 5fecb8d4e7..6706f12b24 100644 --- a/src/corelib/json/qjsonparser.cpp +++ b/src/corelib/json/qjsonparser.cpp @@ -45,7 +45,6 @@ #include #include "qjsonparser_p.h" #include "qjson_p.h" -#include //#define PARSER_DEBUG #ifdef PARSER_DEBUG @@ -769,8 +768,8 @@ static inline bool scanUtf8Char(const char *&json, const char *end, uint *result uc = (uc << 6) | (ch & 0x3f); } - if (uc < min_uc || QUnicodeTables::isNonCharacter(uc) || - (uc >= 0xd800 && uc <= 0xdfff) || uc >= 0x110000) { + if (uc < min_uc || QChar::isNonCharacter(uc) || + QChar::isSurrogate(uc) || uc > QChar::LastValidCodePoint) { return false; } -- cgit v1.2.3