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.
}
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);