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

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

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

Fixed in git, commit fe5bd8cd.

Benno Schulenberg <bens>
Group administrator
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>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

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)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    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.13-758e.
    Corresponding source code