Cargo Features

Sonic-rs has no features set by default.

[dependencies]
sonic-rs = { version = "0.5.0", features = ["arbitrary_precision", "sort_keys", "utf8_lossy", "sanitize"] }
arbitrary_precision

Use an arbitrary precision number type representation when parsing JSON into sonic_rs::Value. This allows the JSON numbers will be serialized without loss of precision.

sort_keys

Sort the keys when serializing sonic_rs::Value.

utf8_lossy

Allow to parse JSON with invalid UTF-8 and UTF-16 characters. Will replace them with \uFFFD (displayed as �).

sanitize

Enable sanitize, maybe cause 30% performance-loss in serialize.