On 4/6/14, 7:24 AM, Jan Novak wrote:
> Chris Down wrote:
>> I don't have much of an opinion on whether this behaviour is right or
>> wrong in the context of bash, but if this behaviour is changed, I think
>> it should be done under another format character, rather than changing
>> %s (or changing behaviour when not in POSIX-compliance mode).
> 
> IMHO my example demonstrates clearly, that printf output of UTF-8 chars is
> broken,
> (doesn't matter, if it is or not POSIX compliant).

Maybe.  Since bash uses whatever printf engine the system's libc provides,
and I don't have any interest in reimplementing fprintf(), we're subject
to printf(3)'s constraints.

> To solve this problem I suppose to add "wide" switch to printf
> or to add "%S" format   (similarly to wprintf(3) )

You might want to look at %ls to use instead of %S, though that doesn't
help you with your field width problem.

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    c...@case.edu    http://cnswww.cns.cwru.edu/~chet/

Reply via email to