From 09b1e3041cdee74588d0ce6cc804f501c0b03ec9 Mon Sep 17 00:00:00 2001 From: Alex Shinn Date: Mon, 11 May 2015 20:40:21 +0900 Subject: [PATCH] Setting utf-8 charset by default. --- lib/chibi/snow/fort.scm | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/chibi/snow/fort.scm b/lib/chibi/snow/fort.scm index 02ac87b1..7a798d1f 100644 --- a/lib/chibi/snow/fort.scm +++ b/lib/chibi/snow/fort.scm @@ -220,6 +220,7 @@ `(html (head (title "Snow") + (meta (@ (charset . "utf-8"))) (link (@ (type . "text/css") (rel . "stylesheet") (href . "/s/snow.css"))) @@ -255,7 +256,12 @@ (let ((sexp? (equal? "sexp" (request-param request "fmt")))) (servlet-write request - (if sexp? - (call-with-current-continuation proc) - (sxml->xml (proc (lambda (x) x))))) + (cond + (sexp? + (call-with-current-continuation proc)) + (else + (let ((res (sxml->xml (proc (lambda (x) x))))) + (servlet-respond request 200 "OK" + '((Content-Type . "text/html; charset=utf-8"))) + res)))) (if sexp? (servlet-write request "\n"))))