Project

General

Profile

Bug #182

dfc doesn't displays unicode names properly

Added by Robin Hahling over 5 years ago. Updated over 2 years ago.

Status:
Rejected
Priority:
Low
Assignee:
-
Target version:
Start date:
05/28/2013
Due date:
% Done:

0%

Estimated time:

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

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

History

#1 Updated by Robin Hahling about 4 years ago

  • Target version set to 3.1.0

#2 Updated by Robin Hahling over 2 years ago

  • Description updated (diff)

#3 Updated by Robin Hahling over 2 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