hooks/post-receive-email: force log messages in UTF-8
commit3109bdb0d157afbd01c412d6f3fb1c86d8b7adde
authorJonathan Nieder <jrnieder@gmail.com>
Fri, 2 Aug 2013 23:23:38 +0000 (2 16:23 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 5 Aug 2013 17:17:36 +0000 (5 10:17 -0700)
treef77c241579bb4783c37529bf388d3f95306d349f
parent1e88f7a277c4cf96a425ffa66e30177b858bc965
hooks/post-receive-email: force log messages in UTF-8

Git commands write commit messages in UTF-8 by default, but that
default can be overridden by the [i18n] commitEncoding and
logOutputEncoding settings.  With such a setting, the emails written
by the post-receive-email hook use a mixture of encodings:

 1. Log messages use the configured log output encoding, which is
    meant to be whatever encoding works best with local terminals
    (and does not have much to do with what encoding should be used
    for email)

 2. Filenames are left as is: on Linux, usually UTF-8, and in the Mingw
    port (which uses Unicode filesystem APIs), always UTF-8

 3. The "This is an automated email" preface uses a project description
    from .git/description, which is typically in UTF-8 to support
    gitweb.

So (1) is configurable, and (2) and (3) are unconfigurable and
typically UTF-8.  Override the log output encoding to always use UTF-8
when writing the email to get the best chance of a comprehensible
single-encoding email.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/hooks/post-receive-email