Skip to content

Commit 21de405

Browse files
committed
P2713R1 Escaping improvements in std::format
Fixes NB US 38-098, FR 5-134 (C++23 CD).
1 parent 9ce105b commit 21de405

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

source/utilities.tex

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15931,12 +15931,20 @@
1593115931
\begin{itemize}
1593215932
\item
1593315933
\placeholder{CE} is a Unicode encoding and
15934-
\placeholder{C} corresponds to either
15935-
a UCS scalar value whose Unicode property \tcode{General_Category}
15936-
has a value in the groups \tcode{Separator} (\tcode{Z}) or \tcode{Other} (\tcode{C}) or to
15937-
a UCS scalar value which has the Unicode property \tcode{Grapheme_Extend=Yes},
15934+
\placeholder{C} corresponds to a UCS scalar value
15935+
whose Unicode property \tcode{General_Category} has a value in the groups
15936+
%FIXME confusing - is the following C supposed to be the same C as above?
15937+
\tcode{Separator} (\tcode{Z}) or \tcode{Other} (\tcode{C}),
1593815938
as described by table 12 of \UAX{44}, or
1593915939

15940+
\item
15941+
\placeholder{CE} is a Unicode encoding and
15942+
\placeholder{C} corresponds to a UCS scalar value
15943+
which has the Unicode property \tcode{Grapheme_Extend=Yes} and
15944+
\placeholder{C} is not immediately preceded in \placeholder{S} by
15945+
a character \placeholder{P} appended to \placeholder{E}
15946+
without translation to an escape sequence, or
15947+
1594015948
\item
1594115949
\placeholder{CE} is not a Unicode encoding and
1594215950
\placeholder{C} is one of an implementation-defined set
@@ -16018,8 +16026,9 @@
1601816026
then \placeholder{C} is appended unchanged.
1601916027
\end{itemize}
1602016028

16021-
%% FIXME: Example is incomplete; s2 and s6 are missing below;
16029+
%% FIXME: Example is incomplete; s2 and s6 from P2286R8 are missing below;
1602216030
%% FIXME: their Unicode characters are not available in our font (Latin Modern).
16031+
%% FIXME: ... same for s8 from P2713R1
1602316032
\begin{example}
1602416033
\begin{codeblock}
1602516034
string s0 = format("[{}]", "h\tllo"); // \tcode{s0} has value: \tcode{[h llo]}
@@ -16030,6 +16039,8 @@
1603016039
string s4 = format("[{:?}]", string("\0 \n \t \x02 \x1b", 9));
1603116040
// \tcode{s4} has value: \tcode{["\textbackslash u\{0\} \textbackslash n \textbackslash t \textbackslash u\{2\} \textbackslash u\{1b\}"]}
1603216041
string s5 = format("[{:?}]", "\xc3\x28"); // invalid UTF-8, \tcode{s5} has value: \tcode{["\textbackslash x\{c3\}("]}
16042+
string s6 = format("[{:?}]", "\u0301"); // s6 has value: ["\u{301}"]
16043+
string s7 = format("[{:?}]", "\\\u0301"); // s7 has value: ["\\\u{301}"]
1603316044
\end{codeblock}
1603416045
\end{example}
1603516046

0 commit comments

Comments
 (0)