Bug 23457 – std.string.wrap has no policy on how it counts columns

Status
NEW
Severity
normal
Priority
P3
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2022-11-04T13:18:48Z
Last change time
2024-12-01T16:40:42Z
Assigned to
No Owner
Creator
Ate Eskola
Moved to GitHub: phobos#10506 →

Comments

Comment #0 by Ajieskola — 2022-11-04T13:18:48Z
There's no hint in documentation of `std.string.wrap` whether it counts the columns by code unit or by code point. Moreover, the function does not even settle on one or the other. Example: ```D // €€ €€ // €€ // wrap("€€ €€ €€", 18).writeln; // €€ €€ €€ // wrap("€€ €€", 18, "€€ ").writeln; ``` These both should print the same result. While either result will do, I'm inclined to think the result should be the one with all '€':s in the same line. The purpose of the function is to fit characters in a certain space, and characters take the same amount of space regardless of encoding.
Comment #1 by robert.schadek — 2024-12-01T16:40:42Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/phobos/issues/10506 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB