[ 
https://issues.apache.org/jira/browse/THRIFT-2411?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14959110#comment-14959110
 ] 

ASF GitHub Bot commented on THRIFT-2411:
----------------------------------------

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)


> 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)

Reply via email to