Quantcast
Channel: WE MOVED to github.com/microsoft/cpprestsdk. This site is not monitored!
Viewing all articles
Browse latest Browse all 4845

Closed Issue: JSON parsing/serializing roundtrip fail [259]

$
0
0
Version: v2.2.0
Compiler: VS 2013
Platform: both Win32/x64

1. The attached input.json (UTF-8) file is read with binary mode into a string.

2. Parse it with

```
std::istrstream is(json);
value root = value::parse(is);
```

3. Serialize it back to a UTF-8 string:

```
std::ostringstream os;
root.serialize(os);
std::string s = os.str();
```

4. The output string is not a valid JSON. Some characters in string literals were not escaped properly. So that it cannot be parsed again. The output string is attached as output.json.

Viewing all articles
Browse latest Browse all 4845

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>