From cae6997dbcf9c71814873fd5884bd1cc47ded304 Mon Sep 17 00:00:00 2001 From: Peter Bex Date: Mon, 5 Oct 2026 13:15:24 +0200 Subject: Use utf-8 charset comprehensively for text(ish) types --- spiffy.scm | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'spiffy.scm') diff --git a/spiffy.scm b/spiffy.scm index 54fb8c9..42c4740 100644 --- a/spiffy.scm +++ b/spiffy.scm @@ -94,21 +94,18 @@ (define mime-type-map (make-parameter '(("html" . #(text/html ((charset . utf-8)))) - ("xhtml" . application/xhtml+xml) - ("js" . application/javascript) + ("xhtml" . #(application/xhtml+xml ((charset . utf-8)))) + ("js" . #(application/javascript ((charset . utf-8)))) ("css" . #(text/css ((charset . utf-8)))) ("png" . image/png) - ;; A charset parameter is STRONGLY RECOMMENDED by RFC 3023 but it overrides - ;; document declarations, so don't supply it (assume nothing about files) - ("xml" . application/xml) - ;; Use text/xml only if it is *truly* human-readable (eg docbook, recipe...) - #;("xml" . text/xml) + ;; NOTE: We now pass in charset, which can be overridden if the user wants + ("xml" . #(application/xml ((charset . utf-8)))) ("pdf" . application/pdf) ("jpeg" . image/jpeg) ("jpg" . image/jpeg) ("gif" . image/gif) ("ico" . image/vnd.microsoft.icon) - ("svg" . image/svg+xml) + ("svg" . #(image/svg+xml ((charset . utf-8)))) ("txt" . #(text/plain ((charset . utf-8))))))) (define default-mime-type (make-parameter 'application/octet-stream)) (define file-extension-handlers (make-parameter '())) -- cgit v1.2.3