Skip to content

Commit

Permalink
Merge 2023-02 LWG Motion 9
Browse files Browse the repository at this point in the history
P2713R1 Escaping improvements in std::format
  • Loading branch information
tkoeppe authored Mar 8, 2023
2 parents 3e04431 + 61b9451 commit f8c3dda
Showing 1 changed file with 16 additions and 5 deletions.
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

0 comments on commit f8c3dda

Please sign in to comment.