aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--ChangeLog.ja6
-rw-r--r--libsylph/codeconv.c18
3 files changed, 21 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 12ada46f..9300b090 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-12-07
+
+ * libsylph/codeconv.c: conv_encode_header(): use outgoing encoding
+ to determine B or Q encoding instead of MB_CUR_MAX.
+
2007-11-08
* libsylph/utils.c: my_memmem(): fixed buffer overrun bug (though
diff --git a/ChangeLog.ja b/ChangeLog.ja
index f23833a4..51d685e1 100644
--- a/ChangeLog.ja
+++ b/ChangeLog.ja
@@ -1,3 +1,9 @@
+2007-12-07
+
+ * libsylph/codeconv.c: conv_encode_header(): B または Q
+ エンコーディングを決定するのに MB_CUR_MAX ではなく送信
+ エンコーディングを使用するようにした。
+
2007-11-08
* libsylph/utils.c: my_memmem(): バッファオーバーランバグを修正
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);