Re: [PATCH] Quick hack to avoid double qp encoding

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Juergen Ruehle <j.ruehle@xxxxxxxx> writes:

> Juergen Ruehle writes:
>
> Ok, i should have also reverted the ' ' to '_' conversion, but it
> seems that send-email is to blame, because it simply copies the
> (possibly) QP encoded author address into the body of a (possibly) not
> QP encoded message.

Thanks.  I think other people would want to hack on this, so I
would make a separete sub to make it easier, like this:

diff --git a/git-send-email.perl b/git-send-email.perl
index ba39d39..8dc2ee0 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -402,6 +402,15 @@ sub make_message_id
 $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);
@@ -555,6 +564,7 @@ foreach my $t (@files) {
 	}
 	close F;
 	if (defined $author_not_sender) {
+		$author_not_sender = unquote_rfc2047($author_not_sender);
 		$message = "From: $author_not_sender\n\n$message";
 	}
 

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]