summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c2cb959)
raw | patch | inline | side by side (parent: c2cb959)
author | Jürgen Rühle <j-r@online.de> | |
Wed, 10 Jan 2007 21:36:39 +0000 (13:36 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Wed, 10 Jan 2007 21:39:16 +0000 (13:39 -0800) |
git-send-email sends out the message taken from format-patch
output without quoting nor encoding. When copying the From:
line to form in-body From: field, it should not copy it
verbatim, because the From: for the header is quoted according
to RFC 2047 when not ASCII.
The original came from Jürgen Rühle, but I moved the
string munging into a separate function so that later other
people can tweak it more easily. Bugs introduced during the
translation are mine.
Signed-off-by: Junio C Hamano <junkio@cox.net>
output without quoting nor encoding. When copying the From:
line to form in-body From: field, it should not copy it
verbatim, because the From: for the header is quoted according
to RFC 2047 when not ASCII.
The original came from Jürgen Rühle, but I moved the
string munging into a separate function so that later other
people can tweak it more easily. Bugs introduced during the
translation are mine.
Signed-off-by: Junio C Hamano <junkio@cox.net>
git-send-email.perl | patch | blob | history |
diff --git a/git-send-email.perl b/git-send-email.perl
index ba39d393843733b46f309deb105c90cabcee2cb1..8dc2ee0cf7461ace62c5ef7afac6dedc7814ddfb 100755 (executable)
--- a/git-send-email.perl
+++ b/git-send-email.perl
$cc = "";
$time = time - scalar $#files;
+sub unquote_rfc2047 {
+ local ($_) = @_;
+ if (s/=\?utf-8\?q\?(.*)\?=/$1/g) {
+ s/_/ /g;
+ s/=([0-9A-F]{2})/chr(hex($1))/eg;
+ }
+ return "$_ - unquoted";
+}
+
sub send_message
{
my @recipients = unique_email_list(@to);
}
close F;
if (defined $author_not_sender) {
+ $author_not_sender = unquote_rfc2047($author_not_sender);
$message = "From: $author_not_sender\n\n$message";
}