[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
UTF-8 printf string formating problem
From: |
Jan Novak |
Subject: |
UTF-8 printf string formating problem |
Date: |
Sun, 06 Apr 2014 01:43:43 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 |
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 bug, because it breaks any non ASCII chars formating.