Filter soft hypen from pager and headers. (closes #3848)
authorKevin McCarthy <kevin@8t8.us>
Thu, 7 Jul 2016 16:21:04 +0000 (09:21 -0700)
committerKevin McCarthy <kevin@8t8.us>
Thu, 7 Jul 2016 16:21:04 +0000 (09:21 -0700)
Add U+00AD SOFT HYPHEN to the filtered characters in headers and the
pager.  In some terminals and situations it causes major display problems.

mbyte.c
pager.c

diff --git a/mbyte.c b/mbyte.c
index adea5f43ef07b45abde9f68e2047e63f1c519c91..d476a3a89a5a190cdddfe03caaff2ad936b44e22 100644 (file)
--- a/mbyte.c
+++ b/mbyte.c
@@ -550,9 +550,11 @@ int mutt_filter_unprintable (char **s)
       wc = '?';
     /* Filter out the RIGHT-TO-LEFT and LEFT-TO-RIGHT bidi markers because
      * they result in screen corruption.   See ticket #3827.
+     * Filter soft-hypen.  See ticket #3848.
      */
     else if (Charset_is_utf8 &&
-             ((wc == (wchar_t)0x200f) || (wc == (wchar_t)0x200e)))
+             ((wc == (wchar_t)0x200f) || (wc == (wchar_t)0x200e) ||
+              (wc == (wchar_t)0x00ad)))
       continue;
     k2 = wcrtomb (scratch, wc, &mbstate2);
     scratch[k2] = '\0';
diff --git a/pager.c b/pager.c
index f256a4ed1fd061567e058ceef32e55ad37644fc9..e6ee9392e47d686f4b7c33625bab50155ae83a09 100644 (file)
--- a/pager.c
+++ b/pager.c
@@ -1156,10 +1156,11 @@ static int format_line (struct line_t **lineInfo, int n, unsigned char *buf,
        dprint (3, (debugfile, "skip zero-width character U+%04X\n", (unsigned short)wc));
        continue;
       }
-      /* Filter bidi markers, see ticket #3827 */
-      if (wc == (wchar_t)0x200f || wc == (wchar_t)0x200e)
+      /* Filter bidi markers, see ticket #3827
+         Filter soft hyphen, see ticket #3848 */
+      if (wc == (wchar_t)0x200f || wc == (wchar_t)0x200e || wc == (wchar_t)0x00ad)
       {
-       dprint (3, (debugfile, "skip bidi marker U+%04X\n", (unsigned short)wc));
+       dprint (3, (debugfile, "filtered U+%04X\n", (unsigned short)wc));
        continue;
       }
     }