bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: utf-8, printf and .prec


From: Aharon Robbins
Subject: Re: utf-8, printf and .prec
Date: Sun, 27 Feb 2011 19:26:33 +0200
User-agent: Heirloom mailx 12.4 7/29/08

Greetings. Thanks for the report. I get correct results with gawk 3.1.8;
please upgrade and try again.

Thanks,

Arnold

> Date: Sun, 27 Feb 2011 10:35:28 +0100
> From: M G Berberich <address@hidden>
> To: address@hidden
> Subject: utf-8, printf and .prec
>
> Hello,
>
> GNU Awk 3.1.7, Debian squeeze, amd64
>
> Problem:
> The .prec modifier in printf to %s should limit the number of
> characters that are printed. This does not work if locale is set to a
> utf-8 (multibyte) locale.
> As gawk claims to be multibyte-aware since 3.1.5 I consider this a bug.
>
> Reproduce:
>
> # works for non-multibyte-locale
> $ echo Halloniergendwo  | LANG=C gawk '{printf("%-10.10s\n", $1)}'
> Hallonierg
>
> # does not work for multibyte-locale
> $ echo Halloniergendwo  | LANG=de_DE.utf-8 gawk '{printf("%-10.10s\n",$1)}'
> Halloniergendwo
>
>       MfG
>       bmg
> -- 
> ???Des is v??llig wurscht, was heut beschlos- | M G Berberich
>  sen wird: I bin sowieso dagegn!???          | address@hidden
> (SPD-Stadtrat Kurt Schindler; Regensburg)  | www.fmi.uni-passau.de/~berberic



reply via email to

[Prev in Thread] Current Thread [Next in Thread]