From: Richard Kettlewell Date: Mon, 23 Jun 2008 22:07:46 +0000 (+0100) Subject: Web interface now advertizes UTF-8 as a charset. This is a workaround X-Git-Tag: 4.1~13 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/disorder/commitdiff_plain/10921eba21e8e74d086854e1e361c381e4661eda Web interface now advertizes UTF-8 as a charset. This is a workaround for its current failure to SGML-quote non-ASCII characters correctly, but is probably the most sensible choice anyway. --- diff --git a/cgi/actions.c b/cgi/actions.c index 611e9a4..a139eaf 100644 --- a/cgi/actions.c +++ b/cgi/actions.c @@ -745,7 +745,7 @@ void dcgi_expand(const char *name, int header) { if(!(found = mx_find(p, 0/*report*/))) fatal(errno, "cannot find %s", p); if(header) { - if(printf("Content-Type: text/html\n" + if(printf("Content-Type: text/html; charset=UTF-8\n" "%s\n" "\n", dcgi_cookie_header()) < 0) fatal(errno, "error writing to stdout"); diff --git a/cgi/cgimain.c b/cgi/cgimain.c index 253f82e..e96bbab 100644 --- a/cgi/cgimain.c +++ b/cgi/cgimain.c @@ -33,7 +33,7 @@ int main(int argc, char **argv) { /* TODO we could make disorder/ACTION equivalent to disorder?action=ACTION */ if(getenv("PATH_INFO")) { /* TODO it might be nice to link back to the right place... */ - printf("Content-Type: text/html\n"); + printf("Content-Type: text/html; charset=UTF-8\n"); printf("Status: 404\n"); printf("\n"); printf("

Sorry, PATH_INFO not supported.

\n");