@matheusbsbs / matheus-bagliano / commits / d1fff6fce0
Fork 0

send-email: use UTF-8 rather than utf-8 for consistency

The rest of the git source has been converted to use upper-case character encoding names to assist older platforms. The charset attribute of MIME is defined to be case-insensitive, but older platforms may still have an easier time dealing with upper-case rather than lower-case. So do so for send-email too. Update t9001 to handle the changes. Signed-off-by: Brandon Casey <drafnel@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Brandon Casey committed Jun 6, 2009 at 20:12 UTC d1fff6fce0e065d1dbb1450146a6f6f79b349229
2 files changed +6 -6
git-send-email.perl
+2 -2
@@ -577,7 +577,7 @@ EOT
577 if ($need_8bit_cte) {
578 print C2 "MIME-Version: 1.0\n",
579 "Content-Type: text/plain; ",
580 - "charset=utf-8\n",
580 + "charset=UTF-8\n",
581 "Content-Transfer-Encoding: 8bit\n";
582 }
583 } elsif (/^MIME-Version:/i) {
@@ -766,7 +766,7 @@ sub unquote_rfc2047 {
766
767 sub quote_rfc2047 {
768 local $_ = shift;
769 - my $encoding = shift || 'utf-8';
769 + my $encoding = shift || 'UTF-8';
770 s/([^-a-zA-Z0-9!*+\/])/sprintf("=%02X", ord($1))/eg;
771 s/(.*)/=\?$encoding\?q\?$1\?=/;
772 return $_;
t/t9001-send-email.sh
+4 -4
@@ -533,7 +533,7 @@ test_expect_success 'utf8 Cc is rfc2047 encoded' '
533 --smtp-server="$(pwd)/fake.sendmail" \
534 outdir/*.patch &&
535 grep "^Cc:" msgtxt1 |
536 - grep "=?utf-8?q?=C3=A0=C3=A9=C3=AC=C3=B6=C3=BA?= <utf8@example.com>"
536 + grep "=?UTF-8?q?=C3=A0=C3=A9=C3=AC=C3=B6=C3=BA?= <utf8@example.com>"
537 '
538
539 test_expect_success '--compose adds MIME for utf8 body' '
@@ -550,7 +550,7 @@ test_expect_success '--compose adds MIME for utf8 body' '
550 --smtp-server="$(pwd)/fake.sendmail" \
551 $patches &&
552 grep "^utf8 body" msgtxt1 &&
553 - grep "^Content-Type: text/plain; charset=utf-8" msgtxt1
553 + grep "^Content-Type: text/plain; charset=UTF-8" msgtxt1
554 '
555
556 test_expect_success '--compose respects user mime type' '
@@ -573,7 +573,7 @@ test_expect_success '--compose respects user mime type' '
573 $patches &&
574 grep "^utf8 body" msgtxt1 &&
575 grep "^Content-Type: text/plain; charset=iso-8859-1" msgtxt1 &&
576 - ! grep "^Content-Type: text/plain; charset=utf-8" msgtxt1
576 + ! grep "^Content-Type: text/plain; charset=UTF-8" msgtxt1
577 '
578
579 test_expect_success '--compose adds MIME for utf8 subject' '
@@ -586,7 +586,7 @@ test_expect_success '--compose adds MIME for utf8 subject' '
586 --smtp-server="$(pwd)/fake.sendmail" \
587 $patches &&
588 grep "^fake edit" msgtxt1 &&
589 - grep "^Subject: =?utf-8?q?utf8-s=C3=BCbj=C3=ABct?=" msgtxt1
589 + grep "^Subject: =?UTF-8?q?utf8-s=C3=BCbj=C3=ABct?=" msgtxt1
590 '
591
592 test_expect_success 'detects ambiguous reference/file conflict' '