+ if (!ret->msg_encoding)
+ ret->msg_encoding = xstrdup("UTF-8");
+
+ while (!end_of_header(p))
+ p = next_header_line(p);
+ while (p && *p == '\n')
+ p++;
+ if (!p)
+ return ret;
+
+ t = strchrnul(p, '\n');
+ ret->subject = substr(p, t);
+ while (*t == '\n')
+ t++;
+ ret->msg = xstrdup(t);
+
+ reencode(&ret->author, ret->msg_encoding, PAGE_ENCODING);
+ reencode(&ret->author_email, ret->msg_encoding, PAGE_ENCODING);
+ reencode(&ret->committer, ret->msg_encoding, PAGE_ENCODING);
+ reencode(&ret->committer_email, ret->msg_encoding, PAGE_ENCODING);
+ reencode(&ret->subject, ret->msg_encoding, PAGE_ENCODING);
+ reencode(&ret->msg, ret->msg_encoding, PAGE_ENCODING);