diff options
-rw-r--r-- | charset.c | 7 | ||||
-rw-r--r-- | charset.h | 1 | ||||
-rw-r--r-- | compose.c | 2 | ||||
-rw-r--r-- | gnupgparse.c | 2 | ||||
-rw-r--r-- | iconv/iconv.c | 8 |
5 files changed, 11 insertions, 9 deletions
@@ -79,9 +79,16 @@ iconv_t mutt_iconv_open (const char *tocode, const char *fromcode) { char tocode1[SHORT_STRING]; char fromcode1[SHORT_STRING]; + char *tmp; mutt_canonical_charset (tocode1, sizeof (tocode1), tocode); + if ((tmp = mutt_charset_hook (tocode1))) + mutt_canonical_charset (tocode1, sizeof (tocode1), tmp); + mutt_canonical_charset (fromcode1, sizeof (fromcode1), fromcode); + if ((tmp = mutt_charset_hook (fromcode1))) + mutt_canonical_charset (fromcode1, sizeof (fromcode1), tmp); + return iconv_open (tocode1, fromcode1); } @@ -57,6 +57,7 @@ int mutt_recode_file (const char *, const char *, const char *); int mutt_convert_string (char **, const char *, const char *); +iconv_t mutt_iconv_open (const char *, const char *); size_t mutt_iconv (iconv_t, const char **, size_t *, char **, size_t *, const char **, const char *); typedef void * FGETCONV; @@ -402,7 +402,7 @@ static int change_attachment_charset (BODY *b) if (mutt_get_field (_("Enter character set: "), buff, sizeof(buff), 0) == -1) return 0; - if ((cd = iconv_open (buff, "us-ascii")) == (iconv_t)-1) + if ((cd = mutt_iconv_open (buff, "us-ascii")) == (iconv_t)-1) { mutt_error (_("Character set %s is unknown."), buff); return 0; diff --git a/gnupgparse.c b/gnupgparse.c index ae54dfdd..0800add8 100644 --- a/gnupgparse.c +++ b/gnupgparse.c @@ -87,7 +87,7 @@ static void fix_uid (char *uid) } *d = '\0'; - if (_chs && (cd = iconv_open (_chs, "utf-8")) != (iconv_t)-1) + if (_chs && (cd = mutt_iconv_open (_chs, "utf-8")) != (iconv_t)-1) { int n = s - uid + 1; /* chars available in original buffer */ char *buf; diff --git a/iconv/iconv.c b/iconv/iconv.c index c80db52d..280e07c0 100644 --- a/iconv/iconv.c +++ b/iconv/iconv.c @@ -656,19 +656,13 @@ static CHARSET *mutt_get_charset (const char *name) CHARSET *charset; char buffer[SHORT_STRING]; char *real_charset; - char *hooked; - + if (!name || !*name) return (NULL); init_charsets(); mutt_canonical_charset (buffer, sizeof(buffer), name); - /* needs to be documented */ - - if ((hooked = mutt_charset_hook (buffer))) - mutt_canonical_charset (buffer, sizeof (buffer), hooked); - dprint (2, (debugfile, "mutt_get_charset: Looking for %s\n", buffer)); if(!CharsetAliases || !(real_charset = hash_find(CharsetAliases, buffer))) |