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.
Comments: Ok I figured out what the issue here is. When parsing from a stream a variable wasn't appropriately being appropriately set to indicate a character needs escaping in the future. This means when serializing later on incorrect json could be produced. Thanks for reporting the issue. This has been fixed in the development branch and will be in the 2.6.0 release. Steve
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.
Comments: Ok I figured out what the issue here is. When parsing from a stream a variable wasn't appropriately being appropriately set to indicate a character needs escaping in the future. This means when serializing later on incorrect json could be produced. Thanks for reporting the issue. This has been fixed in the development branch and will be in the 2.6.0 release. Steve