Skip to content

print.hpp: Control characters not escaped correctly #1937

@Masrepus

Description

@Masrepus

When the caf::json_writer serializes a string to json that contains bytes between 0x00 and 0x1f, the resulting json can't be deserialized correctly by e.g. nlohmann::json. The reason for this is that the print_escaped_to function in print.hpp does not have a special case for these control characters, which should be escaped to \uxxxx. An equivalent from nlohmann would be this piece of code: https://github.com/nlohmann/json/blob/ec7a1d834773f9fee90d8ae908a0c9933c5646fc/src/json.hpp#L4678-L4685

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions