commit 452541a: [Minor] Look also for mime charset
Vsevolod Stakhov
vsevolod at highsecure.ru
Mon Nov 18 20:42:06 UTC 2019
Author: Vsevolod Stakhov
Date: 2019-11-18 20:39:15 +0000
URL: https://github.com/rspamd/rspamd/commit/452541a054bc36557d847f7b9bfe70d4442eccf1 (HEAD -> master)
[Minor] Look also for mime charset
---
src/libmime/mime_encoding.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
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 *
More information about the Commits
mailing list