mirror of
https://github.com/nlohmann/json.git
synced 2026-10-03 13:10:33 +00:00
deploy: 95e9a5931c
This commit is contained in:
@@ -150,6 +150,10 @@ Info
|
||||
|
||||
Any MessagePack output created by `to_msgpack` can be successfully parsed by `from_msgpack`.
|
||||
|
||||
UTF-8 validation of string values
|
||||
|
||||
The MessagePack specification requires `str` values (`fixstr`, `str 8`, `str 16`, `str 32`) to be valid UTF-8. This library validates the bytes of every such string (object keys included) at decode time and rejects ill-formed UTF-8 with a [`parse_error.113`](https://json.nlohmann.me/home/exceptions/#jsonexceptionparse_error113) exception (or, with `allow_exceptions` set to `false`, a discarded value), rather than only failing later when the resulting value is dumped. `bin`/`ext`/`fixext` values are unaffected and are never validated, since they are not required to hold text.
|
||||
|
||||
Example
|
||||
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user