Skip to content

Commit 8db1604

Browse files
committed
Improve P/R as recommended by SG16 (including their optional change)
1 parent da7bf2a commit 8db1604

File tree

1 file changed

+66
-4
lines changed

1 file changed

+66
-4
lines changed

xml/issue4070.xml

Lines changed: 66 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,12 @@ For a non-escaped string, we want the ill-formed sequence to be
6767
formatted as �, which the proposed resolution tries to ensure.
6868
</p>
6969

70-
7170
<note>2024-05-08; Reflector poll</note>
7271
<p>
7372
Set priority to 2 after reflector poll.
7473
</p>
7574

76-
</discussion>
77-
78-
<resolution>
75+
<superseded>
7976
<p>
8077
This wording is relative to <paper num="N4981"/>.
8178
</p>
@@ -115,6 +112,71 @@ transcoding of a formatted `path` when `charT` and `path::value_type` differ
115112
</blockquote>
116113
</li>
117114

115+
</ol>
116+
</superseded>
117+
118+
<note>2025-06-11; SG16 comments and improves wording</note>
119+
<p>
120+
The "and not converting from `wchar_t` to UTF-8" wording added in the index of implementation-defined
121+
behavior by the current proposed resolution should be changed to "and the literal encoding is not UTF-8".
122+
<p/>
123+
It was noted that "the literal encoding" is ambiguous in both the normative wording in
124+
<sref ref="[fs.path.fmtr.funcs]"/> p5 and in the new wording quoted above. In both cases, the intent
125+
is to refer to the "ordinary literal encoding". However, some SG16 participants were reluctant to include
126+
a drive-by fix with the proposed resolution for this issue since the ambiguous literal encoding reference i
127+
s a pre-existing and separable issue. Those same SG16 participants were more concerned that the same
128+
wording was used in both <sref ref="[fs.path.fmtr.funcs]"/> p5 and in the corresponding entry of the
129+
implementation-defined behavior index. I would defer to the LWG chair to decide whether to address this
130+
as an additional related clarification with this change or as a separate editorial or LWG issue.
131+
<p/>
132+
The minimal change is to replace "and not converting from `wchar_t` to UTF-8" with "and the literal encoding
133+
is not UTF-8". The optional change is to insert "ordinary" before "literal encoding" as well. Once that is done,
134+
I'll have SG16 confirm they are content with the new proposed resolution.
135+
</p>
136+
</discussion>
137+
138+
<resolution>
139+
<p>
140+
This wording is relative to <paper num="N5008"/>.
141+
</p>
142+
<ol>
143+
<li><p>Modify <sref ref="[fs.path.fmtr.funcs]"/> as indicated:</p>
144+
145+
<blockquote>
146+
<pre><code>
147+
template&lt;class FormatContext&gt;
148+
typename FormatContext::iterator
149+
format(const filesystem::path&amp; p, FormatContext&amp; ctx) const;
150+
</code></pre>
151+
<blockquote>
152+
<p>
153+
-5-
154+
<em>Effects</em>:
155+
Let `s` be <code>p.generic_string&lt;filesystem::path::value_type&gt;()</code>
156+
if the `g` option is used, otherwise `p.native()`.
157+
Writes `s` into `ctx.out()`, adjusted according to the <i>path-format-spec</i>.
158+
If `charT` is `char`, `path::value_type` is `wchar_t`, and the literal encoding
159+
is UTF-8, then the <del>escaped path</del> <ins>(possibly escaped) string</ins>
160+
is transcoded from the native encoding for wide character strings to UTF-8
161+
with maximal subparts of ill-formed subsequences substituted with
162+
<span style="font-variant:small-caps">u+fffd replacement character</span> per
163+
the Unicode Standard, Chapter 3.9 <span style="font-variant:small-caps">u+fffd</span>
164+
Substitution in Conversion.
165+
If `charT` and `path::value_type` are the same then no transcoding is performed.
166+
Otherwise, transcoding is implementation-defined.
167+
</p>
168+
</blockquote>
169+
</blockquote>
170+
</li>
171+
172+
<li>
173+
Modify the entry in the index of implementation-defined behavior as indicated:
174+
<blockquote>
175+
transcoding of a formatted `path` when `charT` and `path::value_type` differ
176+
<ins>and the ordinary literal encoding is not UTF-8</ins>
177+
</blockquote>
178+
</li>
179+
118180
</ol>
119181
</resolution>
120182

0 commit comments

Comments
 (0)