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

Thomas Klausner tk at giga.or.at
Sun May 25 09:39:06 UTC 2014


Hi!

I'm using the notify extension to send email about commits.
The config uses its own template, as follows:

[notify]
config =
test = false
strip = 5
maxdiff = -1
sources = serve push pull bundle
diffstat = True
template = X-Hg-Repo: {webroot}
 Subject: [hg] push {webroot}
 From: {author}\n
 Module Name:\t{webroot}
 Committed By:\t{author}
 Date:\t\t{date|date}
 Changeset:\t{node|short}\n
 Modified Files:
 \t{files}\n
 Log Message:
 {desc|strip}\n
 To see a diff of this commit:
 {baseurl}{webroot|basename}?cs={node|short}\n


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

sometimes even with:
Content-Type: text/plain; charset="iso-8859-1"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable

and I even managed to get:
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64

but in all cases, the Umlaut is replaced with "?".

A second problem is that when the repository itself contains an
Umlaut, in this case an "ü", I often get "ü" in its place, though I
have at least one email where the headers are

Content-Type: text/plain; charset="iso-8859-1"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable

and the "ü" got translated to =FC and displayed correctly in the mail
client.

Please advise.

Thanks,
 Thomas

P.S.: Please CC me, I'm currently not subscribed.



More information about the Mercurial mailing list