From: Amos Jeffries Date: Mon, 20 Jan 2014 01:20:40 +0000 (+1300) Subject: Set error page Content-Type character set to UTF-8 X-Git-Tag: SQUID_3_5_0_1~404 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ec80c74008c68d53b4287d28384a20b0a66d3a7a;p=thirdparty%2Fsquid.git Set error page Content-Type character set to UTF-8 This fixes issues with some user agents displaying non-English / ASCII error page translations. Our translation system uses and produces UTF-8 templates for the langpack content. It also encourages UTF-8 usage in third-party error pages. --- diff --git a/src/errorpage.cc b/src/errorpage.cc index 8091c4a162..6c25de0ae2 100644 --- a/src/errorpage.cc +++ b/src/errorpage.cc @@ -1166,7 +1166,7 @@ ErrorState::BuildHttpReply() status = Http::scTemporaryRedirect; } - rep->setHeaders(status, NULL, "text/html", 0, 0, -1); + rep->setHeaders(status, NULL, "text/html;charset=utf-8", 0, 0, -1); if (request) { MemBuf redirect_location; @@ -1178,7 +1178,7 @@ ErrorState::BuildHttpReply() httpHeaderPutStrf(&rep->header, HDR_X_SQUID_ERROR, "%d %s", httpStatus, "Access Denied"); } else { MemBuf *content = BuildContent(); - rep->setHeaders(httpStatus, NULL, "text/html", content->contentSize(), 0, -1); + rep->setHeaders(httpStatus, NULL, "text/html;charset=utf-8", content->contentSize(), 0, -1); /* * include some information for downstream caches. Implicit * replaceable content. This isn't quite sufficient. xerrno is not