Skip to content

Commit

Permalink
Wrong upper bound for surrogate pairs
Browse files Browse the repository at this point in the history
  • Loading branch information
RockinRoel committed Mar 28, 2017
1 parent 009599d commit 507418b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Wt/WStringUtil.C
Expand Up @@ -208,7 +208,7 @@ std::wstring fromUTF8(const std::string& s)
cp |= ((unsigned char)s[i+j]) & 0x3F;
}

if (cp >= 0xD800 && cp < 0xF000)
if (cp >= 0xD800 && cp < 0xE000)
legal = false;
else if (sizeof(wchar_t) == 4)
result += (wchar_t)cp;
Expand Down Expand Up @@ -241,7 +241,7 @@ std::wstring fromUTF8(const std::string& s)
cp |= ((unsigned char)s[i+j]) & 0x3F;
}

if (cp >= 0xD800 && cp < 0xF000)
if (cp >= 0xD800 && cp < 0xE000)
legal = false;
else if (sizeof(wchar_t) == 4)
result += (wchar_t)cp;
Expand All @@ -267,7 +267,7 @@ std::wstring fromUTF8(const std::string& s)
cp |= ((unsigned char)s[i+j]) & 0x3F;
}

if (cp >= 0xD800 && cp < 0xF000)
if (cp >= 0xD800 && cp < 0xE000)
legal = false;
else if (sizeof(wchar_t) == 4)
result += (wchar_t)cp;
Expand Down

0 comments on commit 507418b

Please sign in to comment.