diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2007-12-07 08:53:08 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2007-12-07 08:53:08 +0000 |
commit | ff3045b71d336885b3c0895125fb33e98adf1e2b (patch) | |
tree | e3692d8e4d5630c4d0e7ab0a69b28bc20b88e489 /libsylph | |
parent | 0babc209e9160d4c34916af2fc1f7ca09861df1b (diff) |
when encoding headers, use outgoing encoding to determine B or Q encoding instead of MB_CUR_MAX.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@1924 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'libsylph')
-rw-r--r-- | libsylph/codeconv.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/libsylph/codeconv.c b/libsylph/codeconv.c index 6132d806..194c245e 100644 --- a/libsylph/codeconv.c +++ b/libsylph/codeconv.c @@ -2160,20 +2160,22 @@ void conv_encode_header(gchar *dest, gint len, const gchar *src, g_return_if_fail(g_utf8_validate(src, -1, NULL) == TRUE); - if (MB_CUR_MAX > 1) { - use_base64 = TRUE; - mimesep_enc = "?B?"; - } else { - use_base64 = FALSE; - mimesep_enc = "?Q?"; - } - src_encoding = CS_INTERNAL; if (!out_encoding) out_encoding = conv_get_outgoing_charset_str(); if (!strcmp(out_encoding, CS_US_ASCII)) out_encoding = CS_ISO_8859_1; + if (!g_ascii_strncasecmp(out_encoding, "ISO-8859-", 9) || + !g_ascii_strncasecmp(out_encoding, "KOI8-", 5) || + !g_ascii_strncasecmp(out_encoding, "Windows-", 8)) { + use_base64 = FALSE; + mimesep_enc = "?Q?"; + } else { + use_base64 = TRUE; + mimesep_enc = "?B?"; + } + mimestr_len = strlen(MIMESEP_BEGIN) + strlen(mimesep_enc) + strlen(MIMESEP_END); |