[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
utf-8, printf and .prec
From: |
M G Berberich |
Subject: |
utf-8, printf and .prec |
Date: |
Sun, 27 Feb 2011 10:35:28 +0100 |
User-agent: |
Mutt/1.5.20 (2009-06-14) |
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
- utf-8, printf and .prec,
M G Berberich <=