Skip to content

LWG4589 std::format should escape null as \0 #2804

Description

@jwakely

https://cplusplus.github.io/LWG/issue4589

LWG wanted to approve this issue but Davis noticed that this could produce strings which appear to contain an octal literal, e.g. std::format("abc{:?}12", char(0)) yields "abc\u{0}12" today but would change to "abc\012".

This could potentially affect a parser which supports reading octal escapes, and if the output of the std::format call is pasted into source code as a string literal it would be treated as an octal literal \012 rather than as '\0' followed by '1' and '2'.

LEWG should consider whether this matters.

Metadata

Metadata

Assignees

No one assigned

    Labels

    LEWGLibrary Evolution

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions