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

GB225 20.20.02.2 Format alignment specifiers vs. text direction LWG 3327 #222

Closed
wg21bot opened this issue Oct 24, 2019 · 7 comments · Fixed by cplusplus/draft#3748
Closed
Labels
Milestone

Comments

@wg21bot
Copy link
Collaborator

wg21bot commented Oct 24, 2019

std::format() alignment specifiers should be independent of text direction
The align specifiers for formatting standard integer and string types are expressed in terms of "left" and "right". However, "left alignment" as currently defined in the format() specification might end up being right-aligned when the resulting string is displayed in a RTL or bidirectional locale.
This ambiguity can be resolved by removing "left" and "right" and replacing with "start" and "end", without changing any existing implementation and without changing the intent of the feature.

Proposed change:
In [tab:format.align]:
Forces the field to be left-aligned within aligned to the start of the available space
and
Forces the field to be right-aligned within aligned to the end of the available space

@wg21bot wg21bot added the LWG Library label Oct 24, 2019
@wg21bot wg21bot changed the title GB225 20.20.02.2 GB225 20.20.02.2 Format alignment specifiers vs. text direction Oct 24, 2019
@tahonermann tahonermann added the SG16 Unicode label Nov 3, 2019
@tahonermann
Copy link
Collaborator

SG16 plans to discuss this comment Tuesday morning:

@JeffGarland
Copy link
Member

Reviewed Monday in LWG small group.

@tahonermann
Copy link
Collaborator

SG16 in Belfast: recommend to accept.

Rationale: The proposed wording describes current implementation behavior and the desired behavior for right-to-left (RTL) text. For an implementation to conform to the current wording and actually align RTL text in the directions indicated, std::format would be required to insert directional isolate code points around inserted text in order to force binding of padding in one direction or another. The proposed wording avoids the need for any such heroics while allowing programmers to encode such isolates themselves as desired when authoring format strings.

Removing the SG16 label. This is ready for LWG.

SG16 minutes are available at:

@tahonermann tahonermann removed the SG16 Unicode label Nov 5, 2019
@JeffGarland
Copy link
Member

LWG large group wed. Will write and LWG issue to update the wording.

@Dani-Hub
Copy link
Member

Dani-Hub commented Nov 7, 2019

The associated issue is LWG 3327

@cplusplus cplusplus deleted a comment from JeffGarland Nov 7, 2019
@jensmaurer jensmaurer changed the title GB225 20.20.02.2 Format alignment specifiers vs. text direction GB225 20.20.02.2 Format alignment specifiers vs. text direction LWG 3327 Nov 7, 2019
@mclow
Copy link

mclow commented Nov 8, 2019

Friday AM in LWG - accept.

@jensmaurer
Copy link
Member

Accepted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants