diff options
Diffstat (limited to 'lib/jsonParse.impl.cpp')
-rw-r--r-- | lib/jsonParse.impl.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/jsonParse.impl.cpp b/lib/jsonParse.impl.cpp index 3ed8e62..4d13eae 100644 --- a/lib/jsonParse.impl.cpp +++ b/lib/jsonParse.impl.cpp @@ -12,7 +12,7 @@ json::jsonParser::LexerError(const char * msg) void json::jsonParser::appendEscape(const char * cphs, std::string & str) { - appendEscape(std::strtoul(cphs, nullptr, 16), str); + appendEscape(std::strtoul(cphs + 1, nullptr, 16), str); } void @@ -39,4 +39,7 @@ json::jsonParser::appendEscape(unsigned long cp, std::string & str) str += char(((cp >> 6) & 63) + 128); str += char((cp & 63) + 128); } + else { + throw std::range_error("Invalid UTF-8 sequence"); + } } |