git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Junio C Hamano <junkio@cox.net>
Date
Jan 10, 2007, 21:29 UTC
Message-ID
<7vd55ma7ur.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<17829.20111.652000.250228@lapjr.intranet.kiel.bmiag.de>
Juergen Ruehle <j.ruehle@bmiag.de> writes:
Show 6 quoted lines
> 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";
 	}
 
Previous: Juergen RuehleNext: Michael Loeffler
Message 18 of 26 in “Suggest use of "git add file1 file2" when there is nothing to commit.”
  1. 1/2 Suggest use of "git add file1 file2" when there is nothing to commit.Shawn O. Pearce, Dec 16, 2006
  2. Michael LoefflerJan 5, 2007
  3. Junio C HamanoJan 5, 2007
  4. Junio C HamanoJan 6, 2007
  5. Juergen RuehleJan 6, 2007
  6. Junio C HamanoJan 6, 2007
  7. Juergen RuehleJan 6, 2007
  8. Junio C HamanoJan 8, 2007
  9. Juergen RuehleJan 8, 2007
  10. Junio C HamanoJan 8, 2007
  11. Provide better feedback for the untracked only case in status outputJuergen Ruehle, Jan 10, 2007
  12. Juergen RuehleJan 10, 2007
  13. Juergen RuehleJan 10, 2007
  14. Junio C HamanoJan 10, 2007
  15. Juergen RuehleJan 10, 2007
  16. Quick hack to avoid double qp encodingJuergen Ruehle, Jan 10, 2007
  17. Juergen RuehleJan 10, 2007
  18. Junio C HamanoJan 10, 2007
  19. Michael LoefflerJan 10, 2007
  20. Juergen RuehleJan 10, 2007
  21. Provide better feedback for the untracked only case in status outputJuergen Ruehle, Jan 10, 2007
  22. Jeff KingJan 10, 2007
  23. Juergen RuehleJan 11, 2007
  24. Juergen RuehleJan 6, 2007
  25. Michael LoefflerJan 8, 2007
  26. Juergen RuehleJan 9, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.