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

Re: sh emulation POSIX non-conformances (printf %10s and bytes vs character)



On 2021-04-24 08:09:40 +0100, Stephane Chazelas wrote:
> Note that the printf of perl, fish, gawk (and I'd expect most
> modern languages) work at character level (possibly as wrappers
> for C's wprintf()).
> 
> $ perl -CLSA -le 'for (@ARGV) {printf "|%10s|\n", $_}' Stephane Stéphane
> |  Stephane|
> |  Stéphane|

And perl has the same issue as zsh with double-width characters.

-- 
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