The olpc-json crate's CanonicalFormatter does not escape certain control characters, including new lines. This means that when a COB gets serialized that includes new lines, those new lines are serialized verbatim. Upon deserialization `serde_json` -- and any other JSON deserializer -- will fail due to the encounter of these control characters. This behaviour was prevented in radicle-link with the definition of its own CanoncialFormatter that encodes the control characters correctly. Inline this definition of the formatter, under MIT license, to ensure the correct and remove oplc-cjson. The behaviour is checked using a multiline test in the issue COB. Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com> X-Clacks-Overhead: GNU Terry Pratchett |
||
|---|---|---|
| .. | ||
| src | ||
| Cargo.toml | ||