diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-06-02 13:06:40 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-06-02 13:06:40 +0100 |
commit | ed574e92254bcf9994aae909707c66371659fddc (patch) | |
tree | 41119a9bd1afe1dbcb500ff276fb34b5d947310c /src/libmime | |
parent | 92883774725f7ac936e50239ee4b50e9acaa10cc (diff) | |
download | rspamd-ed574e92254bcf9994aae909707c66371659fddc.tar.gz rspamd-ed574e92254bcf9994aae909707c66371659fddc.zip |
[Minor] Try slightly different approach when looking charset aliases
Diffstat (limited to 'src/libmime')
-rw-r--r-- | src/libmime/mime_encoding.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libmime/mime_encoding.c b/src/libmime/mime_encoding.c index 36c37f10b..a44eb755c 100644 --- a/src/libmime/mime_encoding.c +++ b/src/libmime/mime_encoding.c @@ -301,7 +301,7 @@ rspamd_mime_detect_charset (const rspamd_ftok_t *in, rspamd_mempool_t *pool) ret = (char *)s->canon; } - /* Just fucking stupid */ + /* Try different aliases */ cset = ucnv_getCanonicalName (ret, "MIME", &uc_err); if (cset == NULL) { @@ -311,12 +311,12 @@ rspamd_mime_detect_charset (const rspamd_ftok_t *in, rspamd_mempool_t *pool) if (cset == NULL) { uc_err = U_ZERO_ERROR; - cset = ucnv_getCanonicalName (ret, "WINDOWS", &uc_err); + cset = ucnv_getCanonicalName (ret, "", &uc_err); } if (cset == NULL) { uc_err = U_ZERO_ERROR; - cset = ucnv_getCanonicalName (ret, "JAVA", &uc_err); + cset = ucnv_getAlias (ret, 0, &uc_err); } return cset; @@ -389,7 +389,7 @@ rspamd_mime_text_to_utf8 (rspamd_mempool_t *pool, return NULL; } - msg_info_pool ("converted from %s to UTF-8 inlen: %z, outlen: %d", + msg_debug_pool ("converted from %s to UTF-8 inlen: %z, outlen: %d", in_enc, len, r); g_free (tmp_buf); |