Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LWG3639: Handling of fill character width is underspecified in std::format #1150

Closed
tahonermann opened this issue Dec 6, 2021 · 2 comments · Fixed by cplusplus/draft#6144
Labels
C++23 Targeted at C++23 format LWG Library plenary-approved Papers approved for inclusion in their target vehicle by plenary vote.
Milestone

Comments

@tahonermann
Copy link
Collaborator

SG16 needs to clarify the intended design for https://cplusplus.github.io/LWG/issue3639.

 20.20.2.2 [format.string.std] doesn't specify if implementations should consider the estimated width of the fill character when substituting it into the formatted results.

For example:

    auto s = std::format("{:🤡>10}", 42);

"🤡" (U+1F921) is a single code point but its estimated display width is two.

There are at least three possible resolutions:

    1. s == "🤡🤡🤡🤡42": use the estimated display width, correctly displayed on compatible terminals.

    2. s == "🤡🤡🤡🤡🤡🤡🤡🤡42": assume the display width of 1, incorrectly displayed.

    3. Require the fill character to have the estimated width of 1.
@tahonermann tahonermann added LWG Library SG16 Text processing lwg-waiting LWG is waiting on another group to address this issue labels Dec 6, 2021
@jensmaurer jensmaurer added the C++23 Targeted at C++23 label Jan 1, 2022
@jensmaurer jensmaurer added this to the 2022-telecon milestone Jan 1, 2022
@tahonermann
Copy link
Collaborator Author

SG16 discussed (a draft of) P2572R0 at its 2022-06-08 telecon. The following poll was taken:

  • Poll 1: Revise D2572R0 "std::format() fill character allowances" as discussed,
    and forward the paper so revised to LEWG as the recommended resolution of LWG3576
    and LWG3639.
    • Attendance: 8 (2 abstention)

      SF F N A SA
      3 3 0 0 0
    • Consensus in favor.

The changes in the published P2572R0 revision reflect the SG16 requested changes.

Removing the SG16 label; this is ready for LWG pending approval of issue #1260 and (a revision of) P2572 by LEWG.

@tahonermann tahonermann removed the SG16 Text processing label Jun 24, 2022
@JeffGarland JeffGarland added lwg-fullreview Paper is ready for lwg full group review and removed lwg-waiting LWG is waiting on another group to address this issue labels Nov 10, 2022
@jensmaurer jensmaurer modified the milestones: 2022-telecon, 2023-02 Jan 25, 2023
@JeffGarland JeffGarland removed the lwg-fullreview Paper is ready for lwg full group review label Feb 9, 2023
@frederick-vs-ja
Copy link

This should have been fixed by cplusplus/draft#6144.

@jensmaurer jensmaurer added the plenary-approved Papers approved for inclusion in their target vehicle by plenary vote. label Mar 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C++23 Targeted at C++23 format LWG Library plenary-approved Papers approved for inclusion in their target vehicle by plenary vote.
Projects
Status: Ready
Development

Successfully merging a pull request may close this issue.

5 participants