You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I was CBOR serializing a JSON object, and noticed that, whereas when dumping a json object to a string, json string values (i.e., case value_t::string )are escaped (a call to escape_string is made), no such call is made when json values are string values in the CBOR approach.
I was reading the CBOR CRF 7049 and it seems that strings do not need to be escaped when serializing to CBOR.
From your library the behavior is consistent, you don't escape when serializing, nor except to be escaped when de-serializing.
But it appears that Newtonsoft.Json (C# library), expects that. Is it a valid expectation? Is it possible to have a serialization that behaves in this way, in case some libraries expect that behavior?
My use case involves reading the cbor byte string output in c#.
C++ side:
Such output string by then, is wrongly formed: {"characters": [{"name": "Clara Oswald"}, {"name": "Kensi Blye"}, {"name": "Temperance "Bones" Brennan"}]}
and cannot, obviously be parsed:
JObjectoutput_obj= JObject.Parse(output);
The text was updated successfully, but these errors were encountered:
Hi,
I was CBOR serializing a JSON object, and noticed that, whereas when dumping a json object to a string, json string values (i.e., case value_t::string )are escaped (a call to escape_string is made), no such call is made when json values are string values in the CBOR approach.
I was reading the CBOR CRF 7049 and it seems that strings do not need to be escaped when serializing to CBOR.
From your library the behavior is consistent, you don't escape when serializing, nor except to be escaped when de-serializing.
But it appears that Newtonsoft.Json (C# library), expects that. Is it a valid expectation? Is it possible to have a serialization that behaves in this way, in case some libraries expect that behavior?
My use case involves reading the cbor byte string output in c#.
C++ side:
C# side. cbor_bytes is the cbor byte string (c++ output vector)
Such output string by then, is wrongly formed:
{"characters": [{"name": "Clara Oswald"}, {"name": "Kensi Blye"}, {"name": "Temperance "Bones" Brennan"}]}
and cannot, obviously be parsed:
The text was updated successfully, but these errors were encountered: