From: Jeff King Date: Thu, 22 May 2014 09:36:12 +0000 (-0400) Subject: http: default text charset to iso-8859-1 X-Git-Tag: v2.1.0-rc0~112^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c553fd1c1ef76688b6200e66a825b530b0b02140;p=git http: default text charset to iso-8859-1 This is specified by RFC 2616 as the default if no "charset" parameter is given. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- diff --git a/http.c b/http.c index 84463dff3d..2b4f6a357c 100644 --- a/http.c +++ b/http.c @@ -978,6 +978,9 @@ static void extract_content_type(struct strbuf *raw, struct strbuf *type, while (*p && !isspace(*p)) p++; } + + if (!charset->len && starts_with(type->buf, "text/")) + strbuf_addstr(charset, "ISO-8859-1"); } /* http_request() targets */