Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Test ./E03posix.ztst was expected to fail, but passed.



On 2022-03-23 10:38:35 +0000, Stephane Chazelas wrote:
> It's been raised several times on the POSIX mailing list, and
> my understanding the opengroup doesn't consider it as a bug, and
> they have made it clear that they would not address it. They may
> consider specifying ksh93's %Ls (which pads based on display
> width, not byte nor character count) if enough implementations
> start to support it.
> 
> That's why I didn't bother raising it as a bug personally, but
> to me, that position (where printf(1) is meant to be an
> interface to printf(3) without decoding those bytes into
> characters) does not make sense. printf is to print formatted
> text, not doing padding of binary strings. printf(3) was
> extended with wprintf(3) to handle wide characters, printf(1)
> should have been enhanced to switch to that or equivalent just
> like every other text utility is now specified to be able to
> cope with wide characters.

Counting bytes seems useful, e.g. because file formats have fields
with some maximum length in *bytes*. Counting characters seems
less common. It would be more interesting to search for scripts
that use %s with a width and/or a precision, and see what they
expect.

-- 
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)




Messages sorted by: Reverse Date, Date, Thread, Author