diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-11-18 20:39:15 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-11-18 20:39:15 +0000 |
commit | 452541a054bc36557d847f7b9bfe70d4442eccf1 (patch) | |
tree | 9bb442a4a9f65c34cc3a405a7d99eb8efc8a0f44 /src | |
parent | 348e8406b833bb0c4f872d7a7ff39179abaccd4c (diff) | |
download | rspamd-452541a054bc36557d847f7b9bfe70d4442eccf1.tar.gz rspamd-452541a054bc36557d847f7b9bfe70d4442eccf1.zip |
[Minor] Look also for mime charset
Diffstat (limited to 'src')
-rw-r--r-- | src/libmime/mime_encoding.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/libmime/mime_encoding.c b/src/libmime/mime_encoding.c index c3f69edbd..f7a244d0c 100644 --- a/src/libmime/mime_encoding.c +++ b/src/libmime/mime_encoding.c @@ -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) { @@ -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 * |