Created on 2026-06-10.00:00:00 last changed 2 weeks ago
Proposed resolution:
This wording is relative to N5046.
Modify [tab:format.escape.sequences], Table 114 — Mapping of characters to escape sequences:
Character Escape sequence U+0000 NULL \0 … …
[ Brno 2026-06-10; Status changed: New → LEWG. ]
LWG initially approved this as Ready, but Davis pointed out that this would produce strings that resemble an octal literal, e.g. `"abc\0123"`. LEWG should see it.
As currently specified the debug output of std::format for a string containing a null terminator should escape it as \u{0} instead of the more conventional \0.
std::string_view sv("a\0b", 3);
std::print("{:?}", sv); // "a\u{0}b" not "a\0b"
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2026-06-10 11:37:38 | admin | set | status: ready -> lewg |
| 2026-06-10 09:49:08 | admin | set | messages: + msg16402 |
| 2026-06-10 09:49:08 | admin | set | status: new -> ready |
| 2026-06-10 09:13:00 | admin | set | messages: + msg16401 |
| 2026-06-10 00:00:00 | admin | create | |