http://d.puremagic.com/issues/show_bug.cgi?id=7054


Stewart Gordon <s...@iname.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |spec
                 CC|                            |s...@iname.com
            Summary|formatting fixed width      |writef formats strings
                   |string fields w/utf         |containing UTF-8 multibyte
                   |                            |characters to the wrong
                   |                            |width
           Severity|enhancement                 |normal


--- Comment #1 from Stewart Gordon <s...@iname.com> 2011-12-04 18:08:04 PST ---
(In reply to comment #0)
> Using a width specifier in conjunction with a utf string fails.  It would be
> nice to have a %S modifier that handles this situation.

We shouldn't need a different format specifier for this.  It's a matter of what
"Width" means in the format string spec, not one of different kinds of string
format.

http://www.d-programming-language.org/phobos/std_format.html
"Specifies the minimum field width. If the width is a *, the next argument,
which must be of type int, is taken as the width. If the width is negative, it
is as if the - was given as a Flags character."

While it doesn't specify the units the width is measured in, it seems a
reasonable assumption that it is intended to be characters, rather than bytes.

Indeed, 1.071's version gets it right, so clearly the bug is in the D2 line's
implementation.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to