mutt_canonical_charset (buff2, sizeof (buff2), buff);
/* finally, set $charset */
- Charset = safe_strdup (buff);
+ if (!(Charset = safe_strdup (buff)))
+ Charset = safe_strdup ("iso-8859-1");
}
#endif
/* catch some common iso-8859-something misspellings */
if (!mutt_strncasecmp (name, "iso8859", 7) && name[7] != '-')
- snprintf (scratch, sizeof (scratch), "iso_8859-%s", name + 8);
+ snprintf (scratch, sizeof (scratch), "iso_8859-%s", name + 7);
+ else if (!mutt_strncasecmp (name, "iso8859-", 8))
+ snprintf (scratch, sizeof (scratch), "iso8859-%s", name + 8);
else
strfcpy (scratch, NONULL(name), sizeof (scratch));