| ... | ... | @@ -731,8 +731,10 @@ pub fn stringify(writer: anytype, value: anytype, options: std.json.StringifyOpt |
| 731 | 731 | try writer.writeAll("\""); |
| 732 | 732 | for (value) |c| { |
| 733 | 733 | try writer.writeAll(switch (c) { |
| 734 | | 0x20...0x7e => &.{c}, |
| 735 | 734 | 0x0c => "\\n", |
| 735 | 0x20...0x21 => &.{c}, |
| 736 | 0x22 => "\\\"", |
| 737 | 0x23...0x7e => &.{c}, |
| 736 | 738 | else => "\\u00" ++ extras.to_hex([_]u8{c}), |
| 737 | 739 | }); |
| 738 | 740 | } |
| ... | ... | @@ -751,8 +753,10 @@ pub fn stringify(writer: anytype, value: anytype, options: std.json.StringifyOpt |
| 751 | 753 | try writer.writeAll("\""); |
| 752 | 754 | for (&value) |c| { |
| 753 | 755 | try writer.writeAll(switch (c) { |
| 754 | | 0x20...0x7e => &.{c}, |
| 755 | 756 | 0x0c => "\\n", |
| 757 | 0x20...0x21 => &.{c}, |
| 758 | 0x22 => "\\\"", |
| 759 | 0x23...0x7e => &.{c}, |
| 756 | 760 | else => "\\u00" ++ extras.to_hex([_]u8{c}), |
| 757 | 761 | }); |
| 758 | 762 | } |