Skip to content

Commit

Permalink
[Minor] Look also for mime charset
Browse files Browse the repository at this point in the history
  • Loading branch information
vstakhov committed Nov 18, 2019
1 parent 348e840 commit 452541a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/libmime/mime_encoding.c
Expand Up @@ -239,6 +239,7 @@ rspamd_mime_detect_charset (const rspamd_ftok_t *in, rspamd_mempool_t *pool)
{
gchar *ret = NULL, *h, *t;
struct rspamd_charset_substitution *s;
const gchar *cset;
UErrorCode uc_err = U_ZERO_ERROR;

if (sub_hash == NULL) {
Expand Down Expand Up @@ -271,7 +272,13 @@ rspamd_mime_detect_charset (const rspamd_ftok_t *in, rspamd_mempool_t *pool)
return ucnv_getStandardName (s->canon, "IANA", &uc_err);
}

return ucnv_getStandardName (ret, "IANA", &uc_err);
cset = ucnv_getStandardName (ret, "IANA", &uc_err);

if (cset == NULL) {
cset = ucnv_getStandardName (ret, "MIME", &uc_err);
}

return cset;
}

gchar *
Expand Down

0 comments on commit 452541a

Please sign in to comment.