From: Vsevolod Stakhov Date: Mon, 18 Nov 2019 21:17:20 +0000 (+0000) Subject: [Minor] Check for some more aliases, sigh X-Git-Tag: 2.2~8 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=8208b97c7ab0b4b2c0db5fd5ff90048657d605f8;p=rspamd.git [Minor] Check for some more aliases, sigh --- diff --git a/src/libmime/mime_encoding.c b/src/libmime/mime_encoding.c index f7a244d0c..7872fa330 100644 --- a/src/libmime/mime_encoding.c +++ b/src/libmime/mime_encoding.c @@ -272,12 +272,24 @@ rspamd_mime_detect_charset (const rspamd_ftok_t *in, rspamd_mempool_t *pool) return ucnv_getStandardName (s->canon, "IANA", &uc_err); } + /* Just fucking stupid */ cset = ucnv_getStandardName (ret, "IANA", &uc_err); if (cset == NULL) { + uc_err = U_ZERO_ERROR; cset = ucnv_getStandardName (ret, "MIME", &uc_err); } + if (cset == NULL) { + uc_err = U_ZERO_ERROR; + cset = ucnv_getStandardName (ret, "WINDOWS", &uc_err); + } + + if (cset == NULL) { + uc_err = U_ZERO_ERROR; + cset = ucnv_getStandardName (ret, "JAVA", &uc_err); + } + return cset; }