Skip to content

Bug: JSON Parsing Failure for the quoted string #1948

@karuna2git

Description

@karuna2git

Problem/Opportunity

WPEFramework::Core::JSON::String::Deserialize() is skipping the parsing of the string is having a quoted string.

The change landed under #1625 is causing this issue.

Steps to reproduce

Compile n run the program

    int main()
    {
        std::string textIn  =  R"json({"payload":"This is test\" message"})json";
        std::string textOut = "";
        Core::JSON::String json;

        // Text Conversion
        json.FromString(textIn);
        json.ToString(textOut);

        // Print the strings
        printf ("textIn  :: %s\n", textIn.c_str());
        printf ("textOut :: %s\n", textOut.c_str());

         return 0;
    }

Expected Behavior

textIn  :: {"payload":"This is test\" message"}
textOut :: "{\"payload\":\"This is test\\\" message\"}"

Actual Behavior

textIn  :: {"payload":"This is test\" message"}
textOut :: ""

Notes (Optional)

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions