summaryrefslogtreecommitdiffstats
path: root/charset.c
diff options
context:
space:
mode:
authorThomas Roessler <roessler@does-not-exist.org>2001-02-14 23:35:28 +0000
committerThomas Roessler <roessler@does-not-exist.org>2001-02-14 23:35:28 +0000
commit25db60bb28dfeb3fced37723f2968511662f1723 (patch)
tree026ec33f5c5195c88019af8e7828d7da33ff2c01 /charset.c
parentccd5c1a264eba6e4d7f6f0c6a911f495bf5c9727 (diff)
iconv-hook.
Diffstat (limited to 'charset.c')
-rw-r--r--charset.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/charset.c b/charset.c
index a91f23f1..7003eaeb 100644
--- a/charset.c
+++ b/charset.c
@@ -195,10 +195,11 @@ PreferredMIMENames[] =
{ "PCK", "Shift_JIS" },
{ "ko_KR-euc", "euc-kr" },
{ "zh_TW-big5", "big5" },
-
-
-
-
+
+ /* seems to be common on some systems */
+
+ { "sjis", "Shift_JIS" },
+
/* End of aliases. Please keep this line last. */
@@ -306,6 +307,8 @@ iconv_t mutt_iconv_open (const char *tocode, const char *fromcode, int flags)
char fromcode1[SHORT_STRING];
char *tmp;
+ iconv_t cd;
+
mutt_canonical_charset (tocode1, sizeof (tocode1), tocode);
if ((flags & M_ICONV_HOOK_TO) && (tmp = mutt_charset_hook (tocode1)))
mutt_canonical_charset (tocode1, sizeof (tocode1), tmp);
@@ -314,7 +317,10 @@ iconv_t mutt_iconv_open (const char *tocode, const char *fromcode, int flags)
if ((flags & M_ICONV_HOOK_FROM) && (tmp = mutt_charset_hook (fromcode1)))
mutt_canonical_charset (fromcode1, sizeof (fromcode1), tmp);
- return iconv_open (tocode1, fromcode1);
+ if ((cd = iconv_open (tocode1, fromcode1)) != (iconv_t) -1)
+ return cd;
+ /* else */
+ return iconv_open (mutt_iconv_hook (tocode1), mutt_iconv_hook (fromcode1));
}