Bug #182
dfc doesn't displays unicode names properly
0%
Description
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.
See https://bugs.launchpad.net/ubuntu/+source/dfc/+bug/1184702
Files
History
Updated by Robin Hahling over 3 years ago
- File strwidth.patch strwidth.patch added
- Status changed from New to Rejected
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.