summaryrefslogtreecommitdiff
path: root/pretty.c
diff options
context:
space:
mode:
Diffstat (limited to 'pretty.c')
-rw-r--r--pretty.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/pretty.c b/pretty.c
index b9fceed..3209963 100644
--- a/pretty.c
+++ b/pretty.c
@@ -274,7 +274,7 @@ static void add_rfc822_quoted(struct strbuf *out, const char *s, int len)
enum rfc2047_type {
RFC2047_SUBJECT,
- RFC2047_ADDRESS,
+ RFC2047_ADDRESS
};
static int is_rfc2047_special(char ch, enum rfc2047_type type)
@@ -1488,13 +1488,18 @@ void format_commit_message(const struct commit *commit,
context.commit = commit;
context.pretty_ctx = pretty_ctx;
context.wrap_start = sb->len;
+ /*
+ * convert a commit message to UTF-8 first
+ * as far as 'format_commit_item' assumes it in UTF-8
+ */
context.message = logmsg_reencode(commit,
&context.commit_encoding,
- output_enc);
+ utf8);
strbuf_expand(sb, format, format_commit_item, &context);
rewrap_message_tail(sb, &context, 0, 0, 0);
+ /* then convert a commit message to an actual output encoding */
if (output_enc) {
if (same_encoding(utf8, output_enc))
output_enc = NULL;