Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upstd: add fmt option to escape non-printable characters #6218
Conversation
This comment has been hidden.
This comment has been hidden.
7104301
to
90b1aed
| @@ -599,6 +600,16 @@ pub fn formatText( | |||
| try formatInt(c, 16, fmt[0] == 'X', FormatOptions{ .width = 2, .fill = '0' }, writer); | |||
| } | |||
| return; | |||
| } else if (comptime (std.mem.eql(u8, fmt, "e") or std.mem.eql(u8, fmt, "E"))) { | |||
| for (bytes) |c| { | |||
| if (std.ascii.isPrint(c)) { | |||
daurnimator
Sep 1, 2020
Author
Collaborator
For purposes of a debug print: I don't think they should be considered printable:
- its hard to visually tell the difference between a tab that is one space wide an a normal space character.
- I imagine this would often be used for line based output, where escaping newlines is desired.
\r is unprintable
For purposes of a debug print: I don't think they should be considered printable:
- its hard to visually tell the difference between a tab that is one space wide an a normal space character.
- I imagine this would often be used for line based output, where escaping newlines is desired.
\ris unprintable

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.

No description provided.