Bug #182

dfc doesn't displays unicode names properly

Added by Robin Hahling about 6 years ago. Updated about 3 years ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:


It looks like dfc has issues determining unicode strings' length. As /dev/sdXY name are ascii only, this is only visible, for example, when folders are mounted with the "bind" option that include non ascii characters in their name. Although the name is displayed properly, each non ascii character (e.g. "é") is counted as more than one character. This causes the "(=) USED FREE (-)" bar not to be aligned anymore for the lines with these characters.


strwidth.patch (9.33 KB) strwidth.patch Robin Hahling, 07/22/2016 08:44 PM


#1 Updated by Robin Hahling almost 5 years ago

  • Target version set to 3.1.0

#2 Updated by Robin Hahling about 3 years ago

  • Description updated (diff)

#3 Updated by Robin Hahling about 3 years ago

Short story: C and unicode is a nightmare

Long story:
I've attempted things to fix this issue (see attached patch for the record). So computing the width required to display a unicode string is not an issue but then other issues arise. For instance, things like this do not work with unicode strings:

(void)printf("%-*s", max.fsname, fsname);

This means that then one should probably be using wprintf(3) but then it means that all char * need to be converted to wchart_t * and so on. You see the picture. Without using something like the ICU library, it is a nightmare and I am not willing to make ICU a dependency of dfc.

Also available in: Atom PDF