On 04/06/2014 12:56 PM, Dan Douglas wrote:
> On Sunday, April 06, 2014 01:24:58 PM Jan Novak wrote:
>> To solve this problem I suppose to add "wide" switch to printf
>> or to add "%S" format (similarly to wprintf(3) )
>
> ksh93 already has this feature using the "L" modifier:
>
> ksh -c "printf
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 b
On Sunday, April 06, 2014 01:24:58 PM Jan Novak wrote:
> To solve this problem I suppose to add "wide" switch to printf
> or to add "%S" format (similarly to wprintf(3) )
ksh93 already has this feature using the "L" modifier:
ksh -c "printf '%.3Ls\n' $'\u2605\u2605\u2605\u2605\u2605'"
★★★
bash
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).
IM
Jan Novak writes:
> IMHO this is a big bug, because it breaks any non ASCII chars formating.
It is consistent with printf(3).
Andreas.
--
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different.
Jan Novak writes:
> printf string format counts bytes instead of chars, which leads to
> broken output
According to POSIX, printf's field width control is strictly in bytes,
not characters.[0]
> field width:
> An optional string of decimal digits to specify a minimum field
> width. For a
Hello,
printf string format counts bytes instead of chars, which leads to broken
output ... just try this:
(/usr/bin/printf is broken too)
$ echo $LANG
us_US.UTF-8
$ printf "|%4s|\n" "aa"
| aa|
$ printf "|%4s|\n" "áá" (chars are a-acute)
|áá|
expected output:
| áá|
IMHO this is a big b