[ https://issues.apache.org/jira/browse/THRIFT-2411?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14959222#comment-14959222 ]
ASF GitHub Bot commented on THRIFT-2411: ---------------------------------------- Github user phongphan commented on a diff in the pull request: https://github.com/apache/thrift/pull/648#discussion_r42150026 --- 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 -- Thanks :) I have revised the patch to address both suggestions. > C++: UTF-8 sent by PHP as JSON is not understood by TJsonProtocol > ----------------------------------------------------------------- > > Key: THRIFT-2411 > URL: https://issues.apache.org/jira/browse/THRIFT-2411 > Project: Thrift > Issue Type: Sub-task > Components: C++ - Library > Reporter: Jens Geyer > -- This message was sent by Atlassian JIRA (v6.3.4#6332)