diff options
-rw-r--r-- | src/libmime/mime_encoding.c | 12 |
1 files changed, 12 insertions, 0 deletions
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; } |