aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2017-11-17 04:38:34 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2017-11-17 04:38:34 +0000
commit18cbac75df5f14039705fc2a6a7689e768f77ce2 (patch)
treeedea2aec0d77a62269cf2935ca580633788eef59
parentbe730b5824b0ea9af03152031552903d911a3f91 (diff)
modified Content-Transfer-Encoding selection for UTF-16 etc.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@3577 ee746299-78ed-0310-b773-934348b2243d
-rw-r--r--ChangeLog7
-rw-r--r--libsylph/procmime.c6
2 files changed, 11 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 1889c88e..11a41b06 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2017-11-17
+ * libsylph/procmime.c:
+ procmime_get_encoding_for_text_file()
+ procmime_get_encoding_for_str(): count 0x00 and 0x7f as
+ encode-required octet characters.
+
+2017-11-17
+
* src/compose.c: refactored UTF-16 support.
* libsylph/codeconv.c: conv_copy_file(): supported
UTF-16/UTF-16BE/UTF-16LE.
diff --git a/libsylph/procmime.c b/libsylph/procmime.c
index f8f88e4e..f683d4a1 100644
--- a/libsylph/procmime.c
+++ b/libsylph/procmime.c
@@ -1875,8 +1875,9 @@ EncodingType procmime_get_encoding_for_text_file(const gchar *file)
gint i;
for (p = buf, i = 0; i < len; ++p, ++i) {
- if (*p & 0x80)
+ if ((*p & 0x80) || *p == 0x00 || *p == 0x7f) {
++octet_chars;
+ }
}
total_len += len;
}
@@ -1914,8 +1915,9 @@ EncodingType procmime_get_encoding_for_str(const gchar *str)
total_len = strlen(str);
for (p = (const guchar *)str; *p != '\0'; ++p) {
- if (*p & 0x80)
+ if ((*p & 0x80) || *p == 0x7f) {
++octet_chars;
+ }
}
if (total_len > 0)