diff options
author | Kristian Høgsberg <hoegsberg@gmail.com> | 2007-06-01 17:08:12 -0400 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2007-06-02 12:00:26 -0700 |
commit | 996e2d6ea2626f55a59e70ac7305a02ce0171814 (patch) | |
tree | 862992d853778edeff99cb1ade8b703a7af71c7d /commit.c | |
parent | cedb8d5d33e6496cfc70493db841b3db886e8658 (diff) | |
download | git-996e2d6ea2626f55a59e70ac7305a02ce0171814.tar.gz |
Use =20 when rfc2047 encoding spaces.
Encode ' ' using '=20' even though rfc2047 allows using '_' for
readability. Unfortunately, many programs do not understand this and
just leave the underscore in place. Using '=20' seems to work better.
[jc: with adjustment to t3901]
Signed-off-by: Kristian Høgsberg <hoegsberg@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'commit.c')
-rw-r--r-- | commit.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -511,12 +511,16 @@ 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, + * many programs do not understand this and just + * leave the underscore in place. + */ + if (is_rfc2047_special(ch) || ch == ' ') { sprintf(bp, "=%02X", ch); bp += 3; } - else if (ch == ' ') - *bp++ = '_'; else *bp++ = ch; } |