situations where mutt believes it has some really strange us-ascii
alias as the character set.
char *charset, *s, *t, *e, *d = 0;
size_t slen, dlen = 0;
- if (!*pd)
+ /*
+ * A shortcut to detect pure 7bit data.
+ *
+ * This should prevent the worst when character set handling
+ * is flawed.
+ */
+
+ for (s = *pd; *s; s++)
+ if (*s & 0x80)
+ break;
+
+ if (!*s)
return 0;
-
+
if (!Charset || !SendCharset ||
!(charset = mutt_choose_charset (Charset, SendCharset,
*pd, strlen (*pd), &d, &dlen)))