mirror of
https://github.com/nlohmann/json.git
synced 2026-10-09 16:07:14 +00:00
Add tests for error_handler_t::keep in dump() (#4555)
Squashed onto develop from: - Add error_handler_t::keep to copy invalid UTF-8 bytes unchanged - Mention error_handler_t::keep in the README Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
1 parent
e752688b52
commit
3c465beb61
7 files changed
+76
-4
No files matched your search
@@ -64,6 +64,7 @@ serialization fails by default. The fourth argument of `dump` selects an
|
||||
- `strict` (default) — throw a [`type_error.316`](../home/exceptions.md#jsonexceptiontype_error316) exception.
|
||||
- `replace` — replace invalid bytes with the Unicode replacement character U+FFFD (`�`).
|
||||
- `ignore` — silently drop invalid bytes.
|
||||
- `keep` — copy invalid bytes to the output unchanged; the result is not valid UTF-8.
|
||||
|
||||
??? example "Example: serialize invalid UTF-8 with different error handlers"
|
||||
|
||||
|
||||
Reference in new issue
Block a user