Closed webmaster128 closed 3 years ago
As documented in https://github.com/japaric/serde-json-core/blob/238c8fe/src/lib.rs#L46, strings are not escaped in serialization. This leads to broken JSON results when e.g. a " character exists as part of the string content.
"
If someone wants to tackle this, feel free to copy the implementation from https://github.com/CosmWasm/serde-json-wasm/pull/10.
You probably need to work on unescaping at the same time (which is hard and not zero-copy) if you want deserialize(serialize(original)) == original. For a seralize-only use case however, escaping is an important independent step.
deserialize(serialize(original)) == original
As documented in https://github.com/japaric/serde-json-core/blob/238c8fe/src/lib.rs#L46, strings are not escaped in serialization. This leads to broken JSON results when e.g. a
"
character exists as part of the string content.If someone wants to tackle this, feel free to copy the implementation from https://github.com/CosmWasm/serde-json-wasm/pull/10.
You probably need to work on unescaping at the same time (which is hard and not zero-copy) if you want
deserialize(serialize(original)) == original
. For a seralize-only use case however, escaping is an important independent step.