I have an issue with serializing the binary data when the bytes are greater 127 (0x7f). It looks like an upper bit is cut out so I get 0x7f when I want to read 0xff.
Example:
using boost::property_tree::ptree;
ptree pt;
pt.put ("binary", "\xff");
std::stringstream buf;
write_json (buf, pt);
// The JSON looks fine in this case,
// something like { "binary": "\uFFFF" }
ptree pt2;
read_json (buf, pt2);
std::string binary = pt2.get<std::string> ("binary");
// I got 0x7f in binary[0] instead of 0xff
Is this a known issue? Any workaround?