git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git format-patch doesn't add Content-type for UTF-8 diffs
@ 2014-06-30  9:03 Paul Eggert
  2014-06-30 17:30 ` Jeff King
  0 siblings, 1 reply; 4+ messages in thread
From: Paul Eggert @ 2014-06-30  9:03 UTC (permalink / raw)
  To: git

I've been having trouble sending my Git-generated patches to the tz 
mailing list.  Patches containing UTF-8 text are garbled, e.g., if you 
visit <http://mm.icann.org/pipermail/tz/2014-June/021086.html> you'll 
see "Ürümqi" where the patch actually had "Ürümqi".

I've tracked this down to the fact that "git format-patch" isn't 
outputting a Content-Type: line in the outgoing email.  I thought it was 
supposed to do that; the man page implies that it does.

Here's how I can reproduce the bug with the git 1.9.3 that's shipped 
with Fedora 20.  Notice that the patch is missing the line 
"Content-Type: text/plain; charset=UTF-8" that the git-format-patch man 
page implies it should be generating, and this causes the ICANN email 
software to misinterpret the patch's character set encoding.

$ git init
Initialized empty Git repository in /home/eggert/junk/d/.git/
$ echo x >x
$ git add x
$ git commit -m'x'
[master (root-commit) 5d0e0ce] x
  1 file changed, 1 insertion(+)
  create mode 100644 x
$ echo '§' >x
$ git commit -am'added UTF-8'
[master 57f0669] added UTF-8
  1 file changed, 1 insertion(+), 1 deletion(-)
$ git format-patch -1
0001-added-UTF-8.patch
$ cat 0001-added-UTF-8.patch
 From 57f066927a1d8e253715b7980460d81cb549b162 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Mon, 30 Jun 2014 01:49:28 -0700
Subject: [PATCH] added UTF-8

---
  x | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/x b/x
index 587be6b..3038d22 100644
--- a/x
+++ b/x
@@ -1 +1 @@
-x
--
1.9.3

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

end of thread, other threads:[~2014-07-01  4:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-30  9:03 git format-patch doesn't add Content-type for UTF-8 diffs Paul Eggert
2014-06-30 17:30 ` Jeff King
2014-06-30 18:54   ` Paul Eggert
2014-07-01  4:38   ` Torsten Bögershausen

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).