]> diplodocus.org Git - nmh/commitdiff
Don't set c_reqencoding in repl, let mhbuild set it based on
authorDavid Levine <levinedl@acm.org>
Wed, 5 Oct 2016 20:02:47 +0000 (16:02 -0400)
committerDavid Levine <levinedl@acm.org>
Wed, 5 Oct 2016 20:02:47 +0000 (16:02 -0400)
the content.

test/repl/test-convert
uip/mhbuildsbr.c

index d2d398a7573d4aea62b536da354607731c475de4..f7c15dc0ef564ad8f579ad655d887a11beccfed6 100755 (executable)
@@ -25,6 +25,7 @@ LC_ALL=C; export LC_ALL
 
 
 # check -convertarg with multiple parts and additional text in draft
+start_test '-convertarg with multiple parts and additional text in draft'
 cat >"$expected" <<'EOF'
 From: recipient@example.com
 To: sender@example.com
@@ -74,11 +75,13 @@ check "$actual" "$expected"
 
 
 #### Make sure that this works with 8-bit encoding.
+finish_test
 require_locale en_US.utf-8 en_US.utf8
 LC_ALL=en_US.UTF-8; export LC_ALL
 
 
-# check -convertarg with multiple parts and no additional text in draft
+# check -convertarg with multiple parts, 7 bit
+start_test '-convertarg with multiple parts, 7 bit'
 cat >"$expected" <<'EOF'
 From: recipient@example.com
 To: sender@example.com
@@ -89,7 +92,6 @@ Comments: In-reply-to sender@example.com
    message dated "Thu, 11 Dec 2014 08:19:02 -0600."
 MIME-Version: 1.0
 Content-Type: text/plain; charset="UTF-8"
-Content-Transfer-Encoding: 8bit
 
 sender@example.com writes:
 
@@ -112,7 +114,7 @@ Content-Type: text/plain
 This is part 1.
 
 --_001_
-Content-Type: text/plain
+Content-Type: text/plain; charset="UTF-8"
 
 This is part 2.
 
@@ -124,7 +126,55 @@ mhbuild "$actual"
 check "$actual" "$expected"
 
 
+# check -convertarg with multiple parts, 8 bit
+start_test '-convertarg with multiple parts, 8 bit'
+cat >"$expected" <<'EOF'
+From: recipient@example.com
+To: sender@example.com
+cc: 
+Fcc: +outbox
+Subject: Re: test
+Comments: In-reply-to sender@example.com
+   message dated "Thu, 11 Dec 2014 08:19:02 -0600."
+MIME-Version: 1.0
+Content-Type: text/plain; charset="UTF-8"
+Content-Transfer-Encoding: 8bit
+
+sender@example.com writes:
+
+> This is part 1.
+
+> This is §2, with a non-ASCII character.
+EOF
+
+cat >`mhpath new` <<'EOF'
+From: sender@example.com
+To: recipient@example.com
+Subject: test
+Date: Thu, 11 Dec 2014 08:19:02 -0600
+Content-Type: multipart/mixed; boundary="_001_"
+MIME-Version: 1.0
+
+--_001_
+Content-Type: text/plain
+
+This is part 1.
+
+--_001_
+Content-Type: text/plain; charset="UTF-8"
+
+This is §2, with a non-ASCII character.
+
+--_001_--
+EOF
+
+repl -filter mhl.replywithoutbody -convertarg text/plain '' -nowhatnowproc last
+mhbuild "$actual"
+check "$actual" "$expected"
+
+
 # check message with text part in multipart/related
+start_test 'check message with text part in multipart/related'
 cat >"$expected" <<'EOF'
 From: recipient@example.com
 To: sender@example.com
@@ -135,7 +185,6 @@ Comments: In-reply-to sender@example.com
    message dated "."
 MIME-Version: 1.0
 Content-Type: text/plain; charset="UTF-8"
-Content-Transfer-Encoding: 8bit
 
 sender@example.com writes:
 
@@ -153,7 +202,7 @@ MIME-Version: 1.0
 Content-Type: multipart/related; type="text/plain"; boundary="_002_"
 
 --_002_
-Content-Type: text/plain
+Content-Type: text/plain; charset="UTF-8"
 
 This is a test.
 
@@ -168,6 +217,7 @@ check "$actual" "$expected"
 
 
 # check reply to calendar request
+start_test 'check reply to calendar request'
 cat >"$expected" <<'EOF'
 From: recipient@example.com
 To: sender@example.com
@@ -276,4 +326,5 @@ SIGNATURE=Recip mhbuild - <`mhpath +`/draft | egrep -v '^DTSTAMP:' >"$actual"
 check "$actual" "$expected"
 
 
+finish_test
 exit $failed
index b59ea58b0ddc083e94d4e03bbf3753cb6ccba2f8..bf6c8cb92dce79d004c9ad52d8c7af2e0bffae34 100644 (file)
@@ -2292,11 +2292,6 @@ expand_pseudoheader (CT ct, CT *text_plain_ct, struct multipart *m,
     } else {
         set_charset (reply_ct, -1);
         charset = get_param (reply_ct->c_ctinfo.ci_first_pm, "charset", '?', 1);
-        if (reply_ct->c_reqencoding == CE_UNKNOWN) {
-            /* Assume that 8bit is sufficient (for text). */
-            reply_ct->c_reqencoding =
-                strcasecmp (charset, "US-ASCII")  ?  CE_8BIT  :  CE_7BIT;
-        }
     }
 
     /* Concatenate text/plain parts. */
@@ -2309,11 +2304,6 @@ expand_pseudoheader (CT ct, CT *text_plain_ct, struct multipart *m,
             /* Make sure that the charset is set in the text/plain
                part. */
             set_charset (*text_plain_ct, -1);
-            if ((*text_plain_ct)->c_reqencoding == CE_UNKNOWN) {
-                /* Assume that 8bit is sufficient (for text). */
-                (*text_plain_ct)->c_reqencoding =
-                    strcasecmp (charset, "US-ASCII")  ?  CE_8BIT  :  CE_7BIT;
-            }
         }
 
         if (*text_plain_ct) {