GNU bug report logs - #14456
multibyte: stat's %[X] counts bytes instead of characters

Previous Next

Package: coreutils;

Reported by: "camion_spam-debrpbg <at> yahoo.fr" <camion_spam-debrpbg <at> yahoo.fr>

Date: Thu, 23 May 2013 20:43:02 UTC

Severity: wishlist

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "camion_spam-debrpbg <at> yahoo.fr" <camion_spam-debrpbg <at> yahoo.fr>
To: "bug-coreutils <at> gnu.org" <bug-coreutils <at> gnu.org>
Subject: Stat I18N problem with the format string.
Date: Thu, 23 May 2013 21:39:29 +0100 (BST)
[Message part 1 (text/plain, inline)]
stat (GNU coreutils) 8.5

the format string length is counted in bytes and not in characters so that the presence of variable length characters causes misalignment

In the following example the character 'é' is 2 bytes long : 
$ find . | while read P; do LANG=C stat --printf '%16F 0x%f\n' "$P"; done
       directory 0x41ed
   symbolic link 0xa1ff

    regular file 0x81f6
$ find . | while read P; do LANG=fr_BE.UTF-8 stat --printf '%16F 0x%f\n' "$P"; done
     répertoire 0x41ed
 lien symbolique 0xa1ff
         fichier 0x81f6
[Message part 2 (text/html, inline)]

This bug report was last modified 6 years and 244 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.