|
1 | 1 | <?xml version='1.0' encoding='utf-8' standalone='no'?> |
2 | 2 | <!DOCTYPE issue SYSTEM "lwg-issue.dtd"> |
3 | 3 |
|
4 | | -<issue num="4090" status="SG16"> |
| 4 | +<issue num="4090" status="Open"> |
5 | 5 | <title>Underspecified use of locale facets for locale-dependent <tt>std::format</tt></title> |
6 | 6 | <section><sref ref="[format.string.std]"/></section> |
7 | 7 | <submitter>Jens Maurer</submitter> |
@@ -49,11 +49,67 @@ clarify that this is the intended behaviour. |
49 | 49 |
|
50 | 50 | <note>2025-06-12; Jonathan provides wording</note> |
51 | 51 |
|
| 52 | +<superseded> |
| 53 | +<p> |
| 54 | +This wording is relative to <paper num="N5008"/>. |
| 55 | +</p> |
| 56 | + |
| 57 | +<ol> |
| 58 | +<li><p>Modify <sref ref="[format.string.std]"/> as indicated:</p> |
| 59 | + |
| 60 | +<blockquote> |
| 61 | +-17- |
| 62 | +When the `L` option is used, the form used for the conversion is called the |
| 63 | +<i>locale-specific</i> form. |
| 64 | +The `L` option is only valid for arithmetic types, |
| 65 | +and its effect depends upon the type. |
| 66 | +<ol style="list-style-type: none"> |
| 67 | +<li> |
| 68 | +(17.1) — |
| 69 | +For integral types, the locale-specific form causes the context’s locale |
| 70 | +to be used to insert the appropriate digit group separator characters |
| 71 | +<ins> |
| 72 | +as if obtained with <code>numpunct<ins><charT></ins>::grouping</code> |
| 73 | +and <code>numpunct<ins><charT></ins>::thousands_sep</code> |
| 74 | +</ins>. |
| 75 | +</li> |
| 76 | +<li> |
| 77 | +(17.2) — |
| 78 | +For floating-point types, the locale-specific form causes the context’s locale to be used to insert the |
| 79 | +appropriate digit group and radix separator characters |
| 80 | +<ins> |
| 81 | +as if obtained with <code>numpunct<ins><charT></ins>::grouping</code>, |
| 82 | +<code>numpunct<ins><charT></ins>::thousands_sep</code>, and |
| 83 | +<code>numpunct<ins><charT></ins>::decimal_point</code> |
| 84 | +</ins>. |
| 85 | +</li> |
| 86 | +<li> |
| 87 | +(17.3) — |
| 88 | +For the textual representation of `bool`, the locale-specific form causes |
| 89 | +the context’s locale to be used to insert the appropriate string |
| 90 | +as if obtained with <code>numpunct<ins><charT></ins>::truename</code> |
| 91 | +or <code>numpunct<ins><charT></ins>::falsename</code>. |
| 92 | +</li> |
| 93 | +</ol> |
| 94 | +</blockquote> |
| 95 | +</li> |
| 96 | +</ol> |
| 97 | + |
| 98 | +</superseded> |
| 99 | + |
| 100 | +<note>2025-08-27; SG16 meeting</note> |
| 101 | +<p> |
| 102 | +SG16 unanimously approved new wording from Victor. |
| 103 | +The new wording incorporates similar wording as added by <paper num="P2419R2"/> |
| 104 | +to address <iref ref="3565"/>. Status → Open. |
| 105 | +</p> |
| 106 | + |
52 | 107 | </discussion> |
53 | 108 |
|
54 | 109 | <resolution> |
| 110 | + |
55 | 111 | <p> |
56 | | -This wording is relative to <paper num="N5008"/>. |
| 112 | +This wording is relative to <paper num="N5014"/>. |
57 | 113 | </p> |
58 | 114 |
|
59 | 115 | <ol> |
@@ -93,6 +149,12 @@ as if obtained with <code>numpunct<ins><charT></ins>::truename</code> |
93 | 149 | or <code>numpunct<ins><charT></ins>::falsename</code>. |
94 | 150 | </li> |
95 | 151 | </ol> |
| 152 | +<ins> |
| 153 | +If the string literal encoding is a Unicode encoding form |
| 154 | +and the locale is among an implementation-defined set of locales, |
| 155 | +each replacement that depends on the locale is performed as if |
| 156 | +the replacement character sequence is converted to the string literal encoding. |
| 157 | +</ins> |
96 | 158 | </blockquote> |
97 | 159 | </li> |
98 | 160 | </ol> |
|
0 commit comments