Github user hcorg commented on a diff in the pull request: https://github.com/apache/thrift/pull/648#discussion_r42142463 --- Diff: lib/cpp/src/thrift/protocol/TJSONProtocol.cpp --- @@ -736,7 +741,23 @@ uint32_t TJSONProtocol::readJSONString(std::string& str, bool skipContext) { ch = reader_.read(); ++result; if (ch == kJSONEscapeChar) { - result += readJSONEscapeChar(&ch); + uint16_t cp; + result += readJSONEscapeChar(&cp); + // Checking for surrogate pair + if (cp >= 0xD800 && cp <= 0xDBFF) { + codepoints.push_back(cp); + } else { + if (cp >= 0xDC00 && cp <= 0xDFFF --- End diff -- Does 0xDC00 and 0xDFFF have some names? it now looks like some magic number to me :) (btw - instead of adding comment I'd extract it as function, named like comment)
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---