git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Use =20 when rfc2047 encoding spaces.
@ 2007-06-01 21:08 Kristian Høgsberg
  2007-06-01 21:12 ` Jeffrey C. Ollie
  2007-06-02 18:51 ` Junio C Hamano
  0 siblings, 2 replies; 5+ messages in thread
From: Kristian Høgsberg @ 2007-06-01 21:08 UTC (permalink / raw)
  To: git; +Cc: Kristian Høgsberg

Encode ' ' using '=20' even though rfc2047 allows using '_' for
readability.  Unfortunately, much software doesn't understand this and just
leaves the underscore in place.  Using '=20' seems to work better.

Signed-off-by: Kristian Høgsberg <hoegsberg@gmail.com>
---
 commit.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/commit.c b/commit.c
index bee066f..92b46f1 100644
--- a/commit.c
+++ b/commit.c
@@ -511,12 +511,14 @@ static int add_rfc2047(char *buf, const char *line, int len,
 	bp += i;
 	for (i = 0; i < len; i++) {
 		unsigned ch = line[i] & 0xFF;
-		if (is_rfc2047_special(ch)) {
+		/* We encode ' ' using '=20' even though rfc2047
+		 * allows using '_' for readability.  Unfortunately,
+		 * doesn't understand this and just leaves the
+		 * underscore in place. */
+		if (is_rfc2047_special(ch) || ch == ' ') {
 			sprintf(bp, "=%02X", ch);
 			bp += 3;
 		}
-		else if (ch == ' ')
-			*bp++ = '_';
 		else
 			*bp++ = ch;
 	}
-- 
1.5.0.6

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-06-03  0:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-01 21:08 [PATCH] Use =20 when rfc2047 encoding spaces Kristian Høgsberg
2007-06-01 21:12 ` Jeffrey C. Ollie
2007-06-02 18:51 ` Junio C Hamano
2007-06-02 18:58   ` Junio C Hamano
2007-06-03  0:46     ` [PATCH] Update to SubmittingPatches Johannes Schindelin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).