All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Kristian Høgsberg" <hoegsberg@gmail.com>
To: git@vger.kernel.org
Cc: "Kristian Høgsberg" <hoegsberg@gmail.com>
Subject: [PATCH] Use =20 when rfc2047 encoding spaces.
Date: Fri,  1 Jun 2007 17:08:12 -0400	[thread overview]
Message-ID: <11807320922292-git-send-email-hoegsberg@gmail.com> (raw)

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

             reply	other threads:[~2007-06-01 21:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-01 21:08 Kristian Høgsberg [this message]
2007-06-01 21:12 ` [PATCH] Use =20 when rfc2047 encoding spaces 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=11807320922292-git-send-email-hoegsberg@gmail.com \
    --to=hoegsberg@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.