From ff3045b71d336885b3c0895125fb33e98adf1e2b Mon Sep 17 00:00:00 2001 From: hiro Date: Fri, 7 Dec 2007 08:53:08 +0000 Subject: 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 --- libsylph/codeconv.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'libsylph') 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); -- cgit v1.2.3