<<< Date Index >>>     <<< Thread Index >>>

Re: PR mutt/1503: problems with utf-8 terminals



The following reply was made to PR mutt/1503; it has been noted by GNATS.

From: TAKIZAWA Takashi <taki@xxxxxxxxxxxxxxxx>
To: bug-any@xxxxxxxxxxxxx
Cc: 
Subject: Re: PR mutt/1503: problems with utf-8 terminals
Date: Wed, 14 Mar 2007 01:37:22 +0900

 --gKMricLos+KVdGMg
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 
 This cause has mistaken the width of the column for the octet length. 
 The attached patch fixes this. 
 
 On Fri, Mar 09, 2007 at 02:25:02PM +0100,
  Christoph Berg wrote:
 
 > The following reply was made to PR mutt/1503; it has been noted by GNATS.
 > 
 > From: Christoph Berg <cb@xxxxxxxx>
 > To: Mutt Bugs <bug-any@xxxxxxxxxxxxx>
 > Cc: 
 > Subject: Bug#328921: mutt/1503: problems with utf-8 terminals
 > Date: Fri, 9 Mar 2007 14:26:56 +0100
 > 
 >  Hi,
 >  
 >  mutt/1503 is still present in the current version. Stepan provides
 >  some screenshots in Debian bug #328921: (See http://bugs.debian.org/32892=
 >  1)
 
 -- 
 TAKIZAWA Takashi
 http://www.emaillab.org/
 
 
 --gKMricLos+KVdGMg
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: attachment; filename="patch-1.5.14.tt.help-strwidth.1"
 
 diff -r f4d3704813fd help.c
 --- a/help.c   Tue Mar 13 10:58:34 2007 +0100
 +++ b/help.c   Wed Mar 14 01:09:50 2007 +0900
 @@ -183,7 +183,7 @@ static void format_line (FILE *f, int is
    {
      col_a = COLS > 83 ? (COLS - 32) >> 2 : 12;
      col_b = COLS > 49 ? (COLS - 10) >> 1 : 19;
 -    col = pad (f, mutt_strlen(t1), col_a);
 +    col = pad (f, mutt_strwidth(t1), col_a);
    }
  
    if (ismacro > 0)
 @@ -196,7 +196,7 @@ static void format_line (FILE *f, int is
      if (!split)
      {
        col += print_macro (f, col_b - col - 4, &t2);
 -      if (mutt_strlen (t2) > col_b - col)
 +      if (mutt_strwidth (t2) > col_b - col)
        t2 = "...";
      }
    }
 @@ -223,7 +223,7 @@ static void format_line (FILE *f, int is
        SKIPWS(t3);
  
        /* FIXME: this is completely wrong */
 -      if ((n = mutt_strlen (t3)) > COLS - col)
 +      if ((n = mutt_strwidth (t3)) > COLS - col)
        {
          n = COLS - col;
          for (col_a = n; col_a > 0 && t3[col_a] != ' '; col_a--) ;
 
 --gKMricLos+KVdGMg--