about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJonathan Bastien-Filiatrault <joe@x2a.org>2007-10-26 18:13:41 -0400
committerJonathan Bastien-Filiatrault <joe@x2a.org>2007-11-05 18:13:31 -0500
commit7858a309d7671109950ec940f893c2d112d36b99 (patch)
tree676723bafc103e232341aa05be4d57ed773b9feb
parentAdd iconv_msg function. (diff)
downloadcgit-pink-7858a309d7671109950ec940f893c2d112d36b99.tar.gz
cgit-pink-7858a309d7671109950ec940f893c2d112d36b99.zip
Convert subject and message with iconv_msg.
-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
@@ -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;
 }
 
o * initiallyJune McEnroe 2020-02-11Define ColorCap instead of hardcoding 100June McEnroe 2020-02-11Move hash to top of chat.hJune McEnroe 2020-02-11Move base64 out of chat.hJune McEnroe 2020-02-11Move XDG_SUBDIR out of chat.hJune McEnroe 2020-02-11Fix whois idle unit calculationJune McEnroe 2020-02-11Cast towupper to wchar_tJune McEnroe 2020-02-11Cast set but unused variables to voidJune McEnroe 2020-02-11Declare strlcatJune McEnroe 2020-02-11Check if VDSUSP existsJune McEnroe 2020-02-11Fix completeReplace iterationJune McEnroe 2020-02-11Use pkg(8) to configure on FreeBSDJune McEnroe 2020-02-11Remove legacy codeJune McEnroe 2020-02-11Add INSTALLING section to READMEJune McEnroe