diff --git a/json.zig b/json.zig index 6c1f28f8c29f97a937b7bc5b5ed5aff1bc7c8614..e2682d3c7ee66021859d76efb3dc0422cb4b5965 100644 --- a/json.zig +++ b/json.zig @@ -729,7 +729,11 @@ pub fn stringify(writer: anytype, value: anytype, options: std.json.Stringify.Op try writer.writeAll("\""); for (value) |c| { try writer.writeAll(switch (c) { - 0x0c => "\\n", + 0x08 => "\\b", + 0x09 => "\\t", + 0x0a => "\\n", + 0x0c => "\\f", + 0x0d => "\\r", 0x20...0x21 => &.{c}, 0x22 => "\\\"", 0x23...0x7e => &.{c}, @@ -751,7 +755,11 @@ pub fn stringify(writer: anytype, value: anytype, options: std.json.Stringify.Op try writer.writeAll("\""); for (&value) |c| { try writer.writeAll(switch (c) { - 0x0c => "\\n", + 0x08 => "\\b", + 0x09 => "\\t", + 0x0a => "\\n", + 0x0c => "\\f", + 0x0d => "\\r", 0x20...0x21 => &.{c}, 0x22 => "\\\"", 0x23...0x7e => &.{c},