git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: git@vger.kernel.org
Subject: git format-patch doesn't add Content-type for UTF-8 diffs
Date: Mon, 30 Jun 2014 02:03:25 -0700	[thread overview]
Message-ID: <53B127DD.8000807@cs.ucla.edu> (raw)

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

             reply	other threads:[~2014-06-30  9:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-30  9:03 Paul Eggert [this message]
2014-06-30 17:30 ` git format-patch doesn't add Content-type for UTF-8 diffs Jeff King
2014-06-30 18:54   ` Paul Eggert
2014-07-01  4:38   ` Torsten Bögershausen

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=53B127DD.8000807@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --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 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).