diff options
-rwxr-xr-x | git-send-email.perl | 3 | ||||
-rwxr-xr-x | t/t9001-send-email.sh | 17 |
2 files changed, 19 insertions, 1 deletions
diff --git a/git-send-email.perl b/git-send-email.perl index adcb4e397b..efeae4c47a 100755 --- a/git-send-email.perl +++ b/git-send-email.perl @@ -1327,7 +1327,8 @@ foreach my $t (@files) { $body_encoding = $auto_8bit_encoding; } - if ($broken_encoding{$t} && !is_rfc2047_quoted($subject)) { + if ($broken_encoding{$t} && !is_rfc2047_quoted($subject) && + ($subject =~ /[^[:ascii:]]/)) { $subject = quote_rfc2047($subject, $auto_8bit_encoding); } diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh index 89fcedaa33..6c6af7d13f 100755 --- a/t/t9001-send-email.sh +++ b/t/t9001-send-email.sh @@ -1143,6 +1143,23 @@ EOF ' test_expect_success $PREREQ 'setup expect' ' +cat >expected <<EOF +Subject: subject goes here +EOF +' + +test_expect_success $PREREQ 'ASCII subject is not RFC2047 quoted' ' + clean_fake_sendmail && + echo bogus | + git send-email --from=author@example.com --to=nobody@example.com \ + --smtp-server="$(pwd)/fake.sendmail" \ + --8bit-encoding=UTF-8 \ + email-using-8bit >stdout && + grep "Subject" msgtxt1 >actual && + test_cmp expected actual +' + +test_expect_success $PREREQ 'setup expect' ' cat >content-type-decl <<EOF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 |