bugGNU nano - Bugs: bug #56928, the output of --help is misaligned...


You are not allowed to post comments on this tracker with your current authentication level.

bug #56928: the output of --help is misaligned for lines that contain UTF-8 characters

Submitted by:  Benno Schulenberg <bens>
Submitted on:  Sat 21 Sep 2019 10:20:16 AM UTC  
Severity:  4 - Important Status:  Fixed
Assigned to:  Benno Schulenberg <bens> Open/Closed:  Closed

Sat 21 Sep 2019 05:44:50 PM UTC, comment #1: 

Fixed in git, commit fe5bd8cd.

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Sat 21 Sep 2019 10:20:16 AM UTC, original submission:  

To reproduce, run:

  LANGUAGE=es  src/nano --help

See how the description of -T and -r are misaligned.  This happens because printf() sees the "ú" of "número" not as one character but as two (two bytes), because printf() is not UTF-8-aware.

To see a worse example:

  LANGUAGE=uk  src/nano --help

Bug exists since version 4.3.  The offending commit is 2f169107, which was a fix for bug #56372.

The easy "solution" would be to revert that commit, because tabsizes other than 8 will occur far less often than languages with accented letters in the first two columns of the help text.  But... it ought to work right for both those cases.  So we will have to use breadth() to determine the width of each element in the first two columns, and then use spaces to align things.

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.


No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by bens (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.




    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-10-05 bens Severity3 - Normal => 4 - Important
    2019-10-05 bens Open/ClosedOpen => Closed
    2019-09-21 bens StatusNone => Fixed

    Back to the top

    Powered by Savane 3.7