]> git.cameronkatri.com Git - cgit.git/commitdiff
Convert subject and message with iconv_msg.
authorJonathan Bastien-Filiatrault <joe@x2a.org>
Fri, 26 Oct 2007 22:13:41 +0000 (18:13 -0400)
committerJonathan Bastien-Filiatrault <joe@x2a.org>
Mon, 5 Nov 2007 23:13:31 +0000 (18:13 -0500)
parsing.c

index f156c12b7ef6e8ce76a6e844db5ba530e2bc4a56..c7310847561d8d2a7edc11912c2991d12600fef9 100644 (file)
--- a/parsing.c
+++ b/parsing.c
@@ -320,6 +320,20 @@ struct commitinfo *cgit_parse_commit(struct commit *commit)
        } else
                ret->subject = substr(p, p+strlen(p));
 
+       if(strcmp(ret->msg_encoding, PAGE_ENCODING)) {
+               t = iconv_msg(ret->subject, ret->msg_encoding);
+               if(t) {
+                       free(ret->subject);
+                       ret->subject = t;
+               }
+
+               t = iconv_msg(ret->msg, ret->msg_encoding);
+               if(t) {
+                       free(ret->msg);
+                       ret->msg = t;
+               }
+       }
+
        return ret;
 }