notify: how to get utf-8 characters in commit messages into emails?

Thomas Klausner tk at giga.or.at
Sat May 31 16:11:00 UTC 2014


Hi Mads!

On Sun, May 25, 2014 at 01:37:38PM +0200, Mads Kiilerich wrote:
> On 05/25/2014 11:39 AM, Thomas Klausner wrote:
> >The problem I'm seeing is that when the commit message contains utf-8
> >characters like Umlaut-a ("ä", but who knows what my mailer will make
> >of this), the commit mail is sent with the following headers:
> >
> >Content-Type: text/plain; charset="us-ascii"
> >MIME-Version: 1.0
> >Content-Transfer-Encoding: 7bit
> 
> Mercurial's own notifications also get this wrong -
> http://selenic.com/pipermail/mercurial-devel/2013-July/052176.html .
>
> The reason is most likely that the hg process is running in the C locale (or
> some weird 8 bit locale). Depending on your OS, you could set
> LANG=en_US.utf8 or launch Mercurial with --encoding utf-8.

I'm not sure how the server side for ssh push is started, but I guess
it's something like 'ssh server hg something'.

So I've set up my sshd to PermitUserEnvironment and added
LC_CTYPE=en_US.UTF-8
to my ~/.ssh/environment.

And lo-and-behold, it works! Thank you for the tip.

Where would I put the "--encoding utf-8"?
 Thomas



More information about the Mercurial mailing list