[Issue 7054] std.format.formattedWrite uses code units count as width instead of characters count

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Wed Feb 24 06:38:34 PST 2016


https://issues.dlang.org/show_bug.cgi?id=7054

--- Comment #12 from Marco Leise <Marco.Leise at gmx.de> ---
(In reply to hsteoh from comment #10)
> Even if we concede that modern terminals ought to be Unicode-aware (if not
> fully supporting Unicode), there is still the slippery slope of how to print
> bidirectional text, vertical text, scripts that require glyph mutation,
> etc.. Where does one draw the line as to what writefln ought/ought not
> handle?

I tend to think like Steward. If I was using a script other than Latin,
Cyrillic and similarly simple scripts I would most likely expect writefln's
output on a terminal to look like when I print a text file of the same script
to the terminal. Mixing vertical and horizontal text on a terminal is painfully
hard and my expectation is that there is at most an option to render either
horizontally or vertically (transposed). In that case "minimal width" would
become "minimal height" and we are out of trouble.

What exactly do you mean by glyph mutation? In most cases it is probably a task
for the text layout engine the terminal uses. In other cases the user of
writefln should be aware of how their script will display on a terminal and
prepare their text accordingly before printing. There is no simple way to make
plurals work in all languages either:
http://localization-guide.readthedocs.org/en/latest/l10n/pluralforms.html
Is that comparable to what you had in mind?

--


More information about the Digitalmars-d-bugs mailing list