Issue814

Title mercurial: hg email doesn't use correct encoding
Priority bug Status resolved
Superseder Nosy List ThomasAH, blacktrash, bos, brendan, djc, gerardo, mpm, parren, tonfa, vdanjean, wjl
Assigned To Topics patch

Created on 2007-11-02.14:42:27 by vdanjean, last changed 2008-11-02.12:55:44 by djc.

Messages
msg7750 (view) Author: djc Date: 2008-11-02.12:55:44
In main, resolving.
msg7613 (view) Author: djc Date: 2008-10-21.08:43:21
I've pushed the typo fix:

changeset:   7195:9fabcb1fe68d
tag:         tip
user:        Christian Ebert <blacktrash@gmx.net>
date:        Tue Oct 21 10:29:57 2008 +0200
summary:     mail: correct typo in variable name

Thanks!
msg7609 (view) Author: blacktrash Date: 2008-10-21.08:05:26
Typo fix: http://www.selenic.com/pipermail/mercurial-devel/2008-
October/008588.html
msg7595 (view) Author: ThomasAH Date: 2008-10-20.16:38:52
Your newest patches are now in crew
msg7587 (view) Author: blacktrash Date: 2008-10-20.07:26:04
ThomasAH,

Some questions to your answers ;-)

With locales you mean that besides decode/encode(utf-8) I should also check for 
util._encoding == utf-8? Or do you just mean that I shouldn't try other 
charsets? Concerning the latter: I won't; even like this there are risks like 
broken decoding functions in receiving client etc.

base64: that's what python's email module does by default, but it can be set 
explicitly. If I do that, I don't think an additional test is needed.

If you could clarify then I can send updated patches later today.
msg7586 (view) Author: ThomasAH Date: 2008-10-20.06:58:40
I think I like those two patches waiting in your queue.

Some answers to your questions in the patch headers:
- Do not try other locales besides utf-8, because this would be too much
guessing as patches could even contain different encodings per line.
- I prefer base64 encoding as this can easily be extraced from a raw mail and be
applied using 'patch'. With a QP encoded patch with only few 8bit chars you
could very easily miss those, pipe the raw mail to 'patch' and get a broken file.

So with the questions in the commit message changed to statements I'd like to
hae these two applied in general. Could you provide a small automatic test for
these?
msg7584 (view) Author: blacktrash Date: 2008-10-20.06:42:15
Hm, not exactly, as the submitter also wanted *patch* data encoded.

I have 2 more patches that do that for "pure" utf-8 patches. I was reluctant to 
resubmit them as touching patch data might be too risky.

Can again post them to devel so a policy concerning this can be decided. 
Meanwhile they're also at http://www.blacktrash.org/hg/hg-queue/.
msg7576 (view) Author: ThomasAH Date: 2008-10-19.20:37:33
These patches are now in the main repository (ceb8aef03aa7 and its parents)
msg6495 (view) Author: blacktrash Date: 2008-07-10.06:40:51
I've submitted my patches to mercurial-devel again.

imho an otherwise elegant program should not cripple people's
names. Email is not about machine-readability. Which is why I am
proposing a less slim solution.

Also forcing users to keep their commit messages in ascii is a
showstopper for projects that do not deal with code.

At least I got some "normal" users to cooperate with me thanks to
these patches ;)
msg6271 (view) Author: parren Date: 2008-06-13.10:07:12
What's the status here? I've also discovered

  http://marc.info/?t=118443241700002&r=1&w=2

which is an earlier, much simpler, attempt at this, with a response from mpm, a
reply, then nothing.
msg6056 (view) Author: vdanjean Date: 2008-05-21.09:14:21
I've just verified that this bug seems still present with mercurial 1.0
msg5621 (view) Author: blacktrash Date: 2008-03-16.09:35:38
i made a patch queue against crew available at
http://www.blacktrash.org/hg/hg-mail-mq/
in case anyone wants to try, comment, improve.

crew repo with rebased queue at
http://www.blacktrash.org/hg/hg-crew-mq/
msg5335 (view) Author: blacktrash Date: 2008-02-19.21:24:27
i've submitted a rough sketch to deal with this and other stuff
(wrong issue number) at: 
http://www.selenic.com/pipermail/mercurial-devel/2008-February/004933.html ff.
actually for utf-8 it's easy (5. patch).

c
msg4248 (view) Author: vdanjean Date: 2007-11-02.14:42:26
Hi,

  This is the Debian bug #427854 ( http://bugs.debian.org/427854 )
The submitter is working on it upstream. It is still present in 0.9.5

  Best regards,
    Vincent

Wesley J. Landaker wrote:
> Package: mercurial
> Version: 0.9.3-2
> Severity: normal
> 
> hg email (the patchbomb extension) doesn't send patches encoded
> properly. Everything in my repo is UTF-8, and I am running with a UTF-8
> locale, and all the default encoding stuff for mercurial is set to fall
> back to UTF-8, etc.
> 
> However, when I send a patch (of a UTF-8 file) the mail header has:
> 
> Content-Type: text/plain;
>   charset="us-ascii"
> 
> This of course totally breaks the patch for the recipient, unless they
> know how to manually work around it.
> 
> 
> -- System Information:
> Debian Release: lenny/sid
>   APT prefers unstable
>   APT policy: (500, 'unstable'), (40, 'experimental')
> Architecture: i386 (i686)
> 
> Kernel: Linux 2.6.20 (SMP w/2 CPU cores; PREEMPT)
> Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
> Shell: /bin/sh linked to /bin/bash
> 
> Versions of packages mercurial depends on:
> ii  libc6                         2.5-10     GNU C Library: Shared libraries
> ii  python                        2.4.4-6    An interactive high-level object-o
> ii  python-support                0.6.4      automated rebuilding support for p
> ii  python2.4                     2.4.4-4    An interactive high-level object-o
> 
> Versions of packages mercurial recommends:
> pn  kdiff3 | tkdiff | rcs         <none>     (no description available)
> pn  tk8.4 | wish                  <none>     (no description available)
> 
> -- no debconf information
>
History
Date User Action Args
2008-11-02 12:55:44djcsetstatus: testing -> resolved
nosy: mpm, bos, ThomasAH, tonfa, brendan, vdanjean, blacktrash, wjl, parren, djc, gerardo
messages: + msg7750
2008-10-21 08:43:21djcsetnosy: mpm, bos, ThomasAH, tonfa, brendan, vdanjean, blacktrash, wjl, parren, djc, gerardo
messages: + msg7613
2008-10-21 08:05:26blacktrashsetnosy: mpm, bos, ThomasAH, tonfa, brendan, vdanjean, blacktrash, wjl, parren, djc, gerardo
messages: + msg7609
2008-10-20 16:38:53ThomasAHsetstatus: in-progress -> testing
nosy: mpm, bos, ThomasAH, tonfa, brendan, vdanjean, blacktrash, wjl, parren, djc, gerardo
messages: + msg7595
2008-10-20 07:26:09blacktrashsetnosy: mpm, bos, ThomasAH, tonfa, brendan, vdanjean, blacktrash, wjl, parren, djc, gerardo
messages: + msg7587
2008-10-20 06:58:40ThomasAHsetstatus: chatting -> in-progress
nosy: + brendan, mpm, bos, tonfa
messages: + msg7586
2008-10-20 06:42:15blacktrashsetstatus: resolved -> chatting
nosy: ThomasAH, vdanjean, blacktrash, wjl, parren, djc, gerardo
messages: + msg7584
2008-10-19 20:37:33ThomasAHsetstatus: chatting -> resolved
nosy: + ThomasAH
messages: + msg7576
2008-09-03 00:52:19tonfasettopic: + patch
nosy: vdanjean, blacktrash, wjl, parren, djc, gerardo
2008-07-10 06:40:53blacktrashsetnosy: vdanjean, blacktrash, wjl, parren, djc, gerardo
messages: + msg6495
2008-06-13 10:07:16parrensetnosy: vdanjean, blacktrash, wjl, parren, djc, gerardo
messages: + msg6271
2008-06-13 09:30:05parrensetnosy: + parren
2008-05-21 09:14:23vdanjeansetnosy: vdanjean, blacktrash, wjl, djc, gerardo
messages: + msg6056
2008-04-03 21:52:03gerardosetnosy: + gerardo
2008-03-16 09:35:38blacktrashsetnosy: vdanjean, blacktrash, wjl, djc
messages: + msg5621
2008-02-19 21:24:28blacktrashsetstatus: unread -> chatting
nosy: vdanjean, blacktrash, wjl, djc
messages: + msg5335
2008-02-08 07:50:36blacktrashsetnosy: + blacktrash
2007-12-01 01:08:32djcsetnosy: + djc, - 427854
2007-11-02 14:42:27vdanjeancreate