Package: coreutils
Version: 8.25-2
The printf command in bash (builtin) and corutils /usb/bin/printf have
an error in counting the length of a string, if a non-ascii character
is involved.
Example is the arrow - type Alt+I.
Try the following commands:
printf -v r "%-2s X\n" '→' ; echo ${#r} # prints 4
printf -v r "%-2s X\n" ' ' ; echo ${#r} # prints 5
The coreutils version of printf has the same misbehaviour.
The bug leads to ugly output on the console if the data contains such characters. See the 3rd song in the following play queue listing: -------------------------------------------------------------------- Pos. Artist Title Dur. -------------------------------------------------------------------- 1. Bryan Adams I'm Ready 4:26 2. Toto Mrs. Johnson 3:48 3. The Doobie Brothers Long Train Runnin’ 3:39 4. Three Dog Night One 3:02 5. Norman Greenbaum Spirit in the Sky 3:51 --------------------------------------------------------------------
The problem has also another ugly effect in interactive shell usage (here gnome-terminal). I tried to rename a directory with utf-8 chars, but make a silly type in the command. I tried to jump to the start of line with 'ctr+a'. The cursors jumps some chars left of the command (inside the prompt part). example: my Yirumav-Stay_in_Memory_기억에_머무르다/ Yiruma--Stay_in_Memory