From: Kevin McCarthy Date: Wed, 30 Mar 2016 20:16:20 +0000 (-0700) Subject: Filter out bidi marks in rfc2047 and rfc2231 encoding. (see #3827) X-Git-Tag: neomutt-20160404~27 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=48c3c447f197d7285a05271be38f5bb5ff11d385;p=neomutt Filter out bidi marks in rfc2047 and rfc2231 encoding. (see #3827) Filter out U+200F RIGHT-TO-LEFT MARK and U+200E LEFT-TO-RIGHT MARK in rfc2047 and 2231 encoded fields. GNU Screen has a bug that corrupts the display, and can cause the wrong email to appear to be selected in the index. Until screen fixes the issue, filter it out in mutt. --- diff --git a/mbyte.c b/mbyte.c index fb96a7147..470686c9c 100644 --- a/mbyte.c +++ b/mbyte.c @@ -548,6 +548,14 @@ int mutt_filter_unprintable (char **s) } if (!IsWPrint (wc)) wc = '?'; + /* HACK: + * Work around a gnu screen bug. See ticket #3827. + * Filter out the RIGHT-TO-LEFT and LEFT-TO-RIGHT bidi marks because + * they result in screen corruption. + */ + else if (Charset_is_utf8 && + ((wc == (wchar_t)0x200f) || (wc == (wchar_t)0x200e))) + wc = '?'; k2 = wcrtomb (scratch, wc, &mbstate2); scratch[k2] = '\0'; mutt_buffer_addstr (b, scratch);