chiark / gitweb /
Web interface now advertizes UTF-8 as a charset. This is a workaround
authorRichard Kettlewell <rjk@greenend.org.uk>
Mon, 23 Jun 2008 22:07:46 +0000 (23:07 +0100)
committerRichard Kettlewell <rjk@greenend.org.uk>
Mon, 23 Jun 2008 22:07:46 +0000 (23:07 +0100)
for its current failure to SGML-quote non-ASCII characters correctly,
but is probably the most sensible choice anyway.

cgi/actions.c
cgi/cgimain.c

index 611e9a4..a139eaf 100644 (file)
@@ -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");
index 253f82e..e96bbab 100644 (file)
@@ -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("<p>Sorry, PATH_INFO not supported.</p>\n");