Skip to content

Commit c870388

Browse files
committed
Update 4070 with new wording from SG16 and move to Open
1 parent 6267cc8 commit c870388

File tree

1 file changed

+91
-4
lines changed

1 file changed

+91
-4
lines changed

xml/issue4070.xml

Lines changed: 91 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version='1.0' encoding='utf-8' standalone='no'?>
22
<!DOCTYPE issue SYSTEM "lwg-issue.dtd">
33

4-
<issue num="4070" status="SG16">
4+
<issue num="4070" status="Open">
55
<title>Transcoding by <code>std::formatter&lt;std::filesystem::path&gt;</code></title>
66
<section><sref ref="[fs.path.fmtr.funcs]"/></section>
77
<submitter>Jonathan Wakely</submitter>
@@ -133,9 +133,7 @@ The minimal change is to replace "and not converting from `wchar_t` to UTF-8" wi
133133
is not UTF-8". The optional change is to insert "ordinary" before "literal encoding" as well. Once that is done,
134134
I'll have SG16 confirm they are content with the new proposed resolution.
135135
</p>
136-
</discussion>
137-
138-
<resolution>
136+
<superseded>
139137
<p>
140138
This wording is relative to <paper num="N5008"/>.
141139
</p>
@@ -178,6 +176,95 @@ transcoding of a formatted `path` when `charT` and `path::value_type` differ
178176
</li>
179177

180178
</ol>
179+
</superseded>
180+
181+
<note>2025-07-30; SG16 meeting</note>
182+
<p>
183+
SG16 unanimously approved new wording produced during the discussion.
184+
The group concluded that the intended behavior would be best specified by
185+
introducing additional names to denote the sequence of transformations
186+
that produce the intended effect. Status &rarr; Open.
187+
</p>
188+
189+
</discussion>
190+
191+
<resolution>
192+
<p>
193+
This wording is relative to <paper num="N5014"/>.
194+
</p>
195+
<ol>
196+
<li><p>Modify <sref ref="[fs.path.fmtr.funcs]"/> as indicated:</p>
197+
198+
<blockquote>
199+
<pre><code>
200+
template&lt;class FormatContext&gt;
201+
typename FormatContext::iterator
202+
format(const filesystem::path&amp; p, FormatContext&amp; ctx) const;
203+
</code></pre>
204+
<blockquote>
205+
<p>
206+
-5-
207+
<em>Effects</em>:
208+
Let `s` be
209+
<code>p.generic_string<del>&lt;filesystem::path::value_type&gt;</del>()</code>
210+
if the `g` option is used, otherwise `p.native()`.
211+
<ins>Let `s2` be `s` adjusted according to the <em>path-format-spec</em>.
212+
Let `s3` be defined as follows:</ins>
213+
<ol style="list-style-type: none">
214+
<li>
215+
<ins>
216+
(5.1) &mdash;
217+
If `charT` is `char`, `path::value_type` is `wchar_t`,
218+
and the ordinary literal encoding is UTF-8,
219+
`s3` is the result of transcoding `s2`
220+
from the native encoding for wide character strings to UTF-8
221+
with maximal subparts of ill-formed subsequences substituted
222+
with <span style="font-variant:small-caps">U+FFFD REPLACEMENT CHARACTER</span>
223+
per the Unicode Standard, Chapter 3.9
224+
<span style="font-variant:small-caps">U+FFFD</span> Substitution in Conversion.
225+
</ins>
226+
</li>
227+
<li>
228+
<ins>
229+
(5.2) &mdash;
230+
If `charT` and `path::value_type` are the same, then `s3` is the same as `s2`.
231+
</ins>
232+
</li>
233+
<li>
234+
<ins>
235+
(5.3) &mdash;
236+
Otherwise, `s3` is the result of an implementation-defined transcoding of `s2`.
237+
</ins>
238+
</li>
239+
</ol>
240+
<ins>Writes <code>s3</code> into `ctx.out()`.</ins>
241+
<del>
242+
Writes `s` into `ctx.out()`,
243+
adjusted according to the <i>path-format-spec</i>.
244+
If `charT` is `char`, `path::value_type` is `wchar_t`, and the literal encoding
245+
is UTF-8, then the escaped path
246+
is transcoded from the native encoding for wide character strings to UTF-8
247+
with maximal subparts of ill-formed subsequences substituted with
248+
<span style="font-variant:small-caps">u+fffd replacement character</span> per
249+
the Unicode Standard, Chapter 3.9 <span style="font-variant:small-caps">u+fffd</span>
250+
Substitution in Conversion.
251+
If `charT` and `path::value_type` are the same then no transcoding is performed.
252+
Otherwise, transcoding is implementation-defined.
253+
</del>
254+
</p>
255+
</blockquote>
256+
</blockquote>
257+
</li>
258+
259+
<li>
260+
Modify the entry in the index of implementation-defined behavior as indicated:
261+
<blockquote>
262+
transcoding of a formatted `path` when `charT` and `path::value_type` differ
263+
<ins>and the ordinary literal encoding is not UTF-8</ins>
264+
</blockquote>
265+
</li>
266+
</ol>
267+
181268
</resolution>
182269

183270
</issue>

0 commit comments

Comments
 (0)