Skip to content

"Styled string" representation doesn't handle binary data properly #724

Closed
@wolframroesler

Description

@wolframroesler

Since version 1.8.4 it seems that converting Json::Values to JSON strings and back messes up binary data. The following fails:

  std::string s = /* a string with random bytes, not properly UTF-8 encoded */;
  Json::Value a = s;
  std::istringstream iss(a.toStyledString());
  Json::Value b;
  iss >> b;
  JSONTEST_ASSERT(b.asString()==s);

Submitted pull request #725 with a test case that reproduces this behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions