summaryrefslogtreecommitdiffabout
authorJonathan Bastien-Filiatrault <joe@x2a.org>2007-10-26 22:13:41 (UTC)
committer Jonathan Bastien-Filiatrault <joe@x2a.org>2007-11-05 23:13:31 (UTC)
commit7858a309d7671109950ec940f893c2d112d36b99 (patch) (side-by-side diff)
tree676723bafc103e232341aa05be4d57ed773b9feb
parentaf0819830445e39584a0137034562086a55deaf2 (diff)
downloadcgit-7858a309d7671109950ec940f893c2d112d36b99.zip
cgit-7858a309d7671109950ec940f893c2d112d36b99.tar.gz
cgit-7858a309d7671109950ec940f893c2d112d36b99.tar.bz2
Convert subject and message with iconv_msg.
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--parsing.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/parsing.c b/parsing.c
index f156c12..c731084 100644
--- a/parsing.c
+++ b/parsing.c
@@ -315,16 +315,30 @@ struct commitinfo *cgit_parse_commit(struct commit *commit)
p = t + 1;
while (*p == '\n')
p = strchr(p, '\n') + 1;
ret->msg = xstrdup(p);
} 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;
}
struct taginfo *cgit_parse_tag(struct tag *tag)
{
void *data;
enum object_type type;