threads / patch / 8388

patchUse =20 when rfc2047 encoding spaces.

Subject: [PATCH] Use =20 when rfc2047 encoding spaces.

## tl;dr

5 messages between Jun 1, 2007 and Jun 3, 2007. Diffs are folded; open one to read it.

replies: 4people: 4as markdown or json

Kristian Høgsberg· Jun 1, 2007, 21:08 UTC · lore

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(-)
Show changes to commit.c +5 −3
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· Jun 1, 2007, 21:12 UTC · re: Kristian Høgsberg · lore

Re: [PATCH] Use =20 when rfc2047 encoding spaces.

On Fri, 2007-06-01 at 17:08 -0400, Kristian Høgsberg wrote:
Show 7 quoted lines
>
> -		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· Jun 2, 2007, 18:51 UTC · re: Kristian Høgsberg · lore

Re: [PATCH] Use =20 when rfc2047 encoding spaces.

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· Jun 2, 2007, 18:58 UTC · re: Junio C Hamano · lore

Re: [PATCH] Use =20 when rfc2047 encoding spaces.

Junio C Hamano <junkio@cox.net> writes:
Show 10 quoted lines
> 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· Jun 3, 2007, 00:46 UTC · re: Junio C Hamano · lore

[PATCH] Update to SubmittingPatches

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(-)
Show changes to Documentation/SubmittingPatches +4 −0
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

← back to recent threads