git-send-email: skip RFC2047 quoting for ASCII subjects

The git-send-email always use RFC2047 subject quoting for
files with "broken" encoding - non-ASCII files without
Content-Transfer-Encoding, even for ASCII subjects. This is
harmless but unnecessarily ugly for people reading the raw
headers. This patch skips rfc2047 quoting when the subject
does not need it.

Signed-off-by: Krzysztof Mazur <krzysiek@podlesie.net>
Signed-off-by: Jeff King <peff@peff.net>
This commit is contained in:
Krzysztof Mazur
2012-10-24 10:03:35 +02:00
committed by Jeff King
parent 4a47a4ddec
commit 5637d85732
2 changed files with 19 additions and 1 deletions

View File

@@ -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);
}