Skip to content

Parse error while parse the json string contains UTF 8 encoded document bytes string #684

Description

@sivapooja

Hi,
I am sending json string with UTF 8 encoded document bytees string from asp.net and receiving the json from c++ program , i am getting parse error while trying to parse the received json string to json object

        string jsonStr = string( body.begin(), body.end() );               
         json j = json::parse(jsonStr);

Asp.net Json string

string docBytesStr = System.Text.Encoding.UTF8.GetString(docBytes, 0, docBytes.Length);
string jsonData = "{ \"template\" : \"1\", \"doc\":\"" + docBytesStr + "\"  }";

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions