Skip to content

[LWG 9] P2713R1 Escaping improvements in std::format #6139

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions source/utilities.tex
Original file line number Diff line number Diff line change
Expand Up @@ -15963,12 +15963,20 @@
\begin{itemize}
\item
\placeholder{CE} is UTF-8, UTF-16, or UTF-32 and
\placeholder{C} corresponds to either
a Unicode scalar value whose Unicode property \tcode{General_Category}
has a value in the groups \tcode{Separator} (\tcode{Z}) or \tcode{Other} (\tcode{C}) or to
a Unicode scalar value with the Unicode property \tcode{Grapheme_Extend=Yes},
\placeholder{C} corresponds to a Unicode scalar value
whose Unicode property \tcode{General_Category} has a value in the groups
\tcode{Separator} (\tcode{Z}) or \tcode{Other} (\tcode{C}),
as described by \UAX{44} of the Unicode Standard, or

\item
\placeholder{CE} is UTF-8, UTF-16, or UTF-32 and
\placeholder{C} corresponds to a Unicode scalar value
with the Unicode property \tcode{Grapheme_Extend=Yes}
as described by \UAX{44} of the Unicode Standard and
\placeholder{C} is not immediately preceded in \placeholder{S} by
a character \placeholder{P} appended to \placeholder{E}
without translation to an escape sequence, or

\item
\placeholder{CE} is neither UTF-8, UTF-16, nor UTF-32 and
\placeholder{C} is one of an implementation-defined set
Expand Down Expand Up @@ -16050,7 +16058,8 @@
then \placeholder{C} is appended unchanged.
\end{itemize}

%% FIXME: Example is incomplete; s2 and s6 are missing below;
%% FIXME: Example is incomplete; s2 and s6 from P2286R8
%% and s8 (which should be s9) from P2713R1 are missing below;
%% FIXME: their Unicode characters are not available in our font (Latin Modern).
\begin{example}
\begin{codeblock}
Expand All @@ -16062,6 +16071,8 @@
string s4 = format("[{:?}]", string("\0 \n \t \x02 \x1b", 9));
// \tcode{s4} has value: \tcode{["\textbackslash u\{0\} \textbackslash n \textbackslash t \textbackslash u\{2\} \textbackslash u\{1b\}"]}
string s5 = format("[{:?}]", "\xc3\x28"); // invalid UTF-8, \tcode{s5} has value: \tcode{["\textbackslash x\{c3\}("]}
string s7 = format("[{:?}]", "\u0301"); // \tcode{s7} has value: \tcode{["\u{301}"]}
string s8 = format("[{:?}]", "\\\u0301"); // \tcode{s8} has value: \tcode{["\\\u{301}"]}
\end{codeblock}
\end{example}

Expand Down