Skip to content

Commit d1fff6f

Browse files
drafnelgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent a3a8262 commit d1fff6f

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

git-send-email.perl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,7 @@ ($)
577577
if ($need_8bit_cte) {
578578
print C2 "MIME-Version: 1.0\n",
579579
"Content-Type: text/plain; ",
580-
"charset=utf-8\n",
580+
"charset=UTF-8\n",
581581
"Content-Transfer-Encoding: 8bit\n";
582582
}
583583
} elsif (/^MIME-Version:/i) {
@@ -766,7 +766,7 @@ sub unquote_rfc2047 {
766766

767767
sub quote_rfc2047 {
768768
local $_ = shift;
769-
my $encoding = shift || 'utf-8';
769+
my $encoding = shift || 'UTF-8';
770770
s/([^-a-zA-Z0-9!*+\/])/sprintf("=%02X", ord($1))/eg;
771771
s/(.*)/=\?$encoding\?q\?$1\?=/;
772772
return $_;

t/t9001-send-email.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ test_expect_success 'utf8 Cc is rfc2047 encoded' '
533533
--smtp-server="$(pwd)/fake.sendmail" \
534534
outdir/*.patch &&
535535
grep "^Cc:" msgtxt1 |
536-
grep "=?utf-8?q?=C3=A0=C3=A9=C3=AC=C3=B6=C3=BA?= <[email protected]>"
536+
grep "=?UTF-8?q?=C3=A0=C3=A9=C3=AC=C3=B6=C3=BA?= <[email protected]>"
537537
'
538538

539539
test_expect_success '--compose adds MIME for utf8 body' '
@@ -550,7 +550,7 @@ test_expect_success '--compose adds MIME for utf8 body' '
550550
--smtp-server="$(pwd)/fake.sendmail" \
551551
$patches &&
552552
grep "^utf8 body" msgtxt1 &&
553-
grep "^Content-Type: text/plain; charset=utf-8" msgtxt1
553+
grep "^Content-Type: text/plain; charset=UTF-8" msgtxt1
554554
'
555555

556556
test_expect_success '--compose respects user mime type' '
@@ -573,7 +573,7 @@ test_expect_success '--compose respects user mime type' '
573573
$patches &&
574574
grep "^utf8 body" msgtxt1 &&
575575
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
577577
'
578578

579579
test_expect_success '--compose adds MIME for utf8 subject' '
@@ -586,7 +586,7 @@ test_expect_success '--compose adds MIME for utf8 subject' '
586586
--smtp-server="$(pwd)/fake.sendmail" \
587587
$patches &&
588588
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
590590
'
591591

592592
test_expect_success 'detects ambiguous reference/file conflict' '

0 commit comments

Comments
 (0)