# [PATCH] Use =20 when rfc2047 encoding spaces.

5 messages from 2007-06-01 to 2007-06-03. Participants: Kristian Høgsberg, Jeffrey C. Ollie, Junio C Hamano, Johannes Schindelin.
Thread: https://gitlist.dev/t/8388

## Kristian Høgsberg, 2007-06-01 21:08

Subject: [PATCH] Use =20 when rfc2047 encoding spaces.
Message-ID: <11807320922292-git-send-email-hoegsberg@gmail.com>
URL: https://gitlist.dev/e/11807320922292-git-send-email-hoegsberg%40gmail.com

```
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

```

## Jeffrey C. Ollie, 2007-06-01 21:12

Subject: Re: [PATCH] Use =20 when rfc2047 encoding spaces.
Message-ID: <1180732323.3890.33.camel@lt21223.campus.dmacc.edu>
URL: https://gitlist.dev/e/1180732323.3890.33.camel%40lt21223.campus.dmacc.edu
In-Reply-To: <11807320922292-git-send-email-hoegsberg@gmail.com>

```
On Fri, 2007-06-01 at 17:08 -0400, Kristian Høgsberg wrote:
>
> -		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 == ' ') {

Looks like "much software" got left out of the comment.

Jeff


```

## Junio C Hamano, 2007-06-02 18:51

Subject: Re: [PATCH] Use =20 when rfc2047 encoding spaces.
Message-ID: <7vd50eqjef.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vd50eqjef.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <11807320922292-git-send-email-hoegsberg@gmail.com>

```
Kristian Høgsberg <hoegsberg@gmail.com> writes:

> Encode ' ' using '=20' even though rfc2047 allows using '_' for
> readability..

Thanks.

Your message was marked as iso-8859-1 even though it was utf-8
(your signed-off-by line), so I'll fix it up with your From:
header.

```

## Junio C Hamano, 2007-06-02 18:58

Subject: Re: [PATCH] Use =20 when rfc2047 encoding spaces.
Message-ID: <7v8xb2qj37.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7v8xb2qj37.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <7vd50eqjef.fsf@assigned-by-dhcp.cox.net>

```
Junio C Hamano <junkio@cox.net> writes:

> Kristian Høgsberg <hoegsberg@gmail.com> writes:
>
>> Encode ' ' using '=20' even though rfc2047 allows using '_' for
>> readability..
>
> Thanks.
>
> Your message was marked as iso-8859-1 even though it was utf-8
> (your signed-off-by line), so I'll fix it up with your From:
> header.

Oh, another thing.  Before you submit a patch, make sure the
whole testsuite in t/ passes by running "make test".

```

## Johannes Schindelin, 2007-06-03 00:46

Subject: [PATCH] Update to SubmittingPatches
Message-ID: <Pine.LNX.4.64.0706030145420.4046@racer.site>
URL: https://gitlist.dev/e/Pine.LNX.4.64.0706030145420.4046%40racer.site
In-Reply-To: <7v8xb2qj37.fsf@assigned-by-dhcp.cox.net>

```

Make people aware of our testsuite, and of non-ASCII encodings.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---

	On Sat, 2 Jun 2007, Junio C Hamano wrote:

	> Junio C Hamano <junkio@cox.net> writes:
	> 
	> > Kristian Høgsberg <hoegsberg@gmail.com> writes:
	> >
	> >> Encode ' ' using '=20' even though rfc2047 allows using '_' for
	> >> readability..
	> >
	> > Thanks.
	> >
	> > Your message was marked as iso-8859-1 even though it was utf-8
	> > (your signed-off-by line), so I'll fix it up with your From:
	> > header.
	> 
	> Oh, another thing.  Before you submit a patch, make sure the
	> whole testsuite in t/ passes by running "make test".

	We should remind people of both.

 Documentation/SubmittingPatches |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/Documentation/SubmittingPatches b/Documentation/SubmittingPatches
index b5f2ecd..b6e5847 100644
--- a/Documentation/SubmittingPatches
+++ b/Documentation/SubmittingPatches
@@ -14,6 +14,8 @@ Checklist (and a short version for the impatient):
 	  commit message (or just use the option "-s" when
 	  committing) to confirm that you agree to the Developer's
 	  Certificate of Origin
+	- make sure that you have tests for the bug you are fixing
+	- make sure that the test suit passes after your commit
 
 	Patch:
 
@@ -33,6 +35,8 @@ Checklist (and a short version for the impatient):
 	- if you change, add, or remove a command line option or
 	  make some other user interface change, the associated
 	  documentation should be updated as well.
+	- if your name is not writable in ASCII, make sure that 
+	  you send off a message in the correct encoding.
 
 Long version:
 
-- 
1.5.2.2663.gd77e7-dirty

```
