diff options
-rw-r--r-- | nar-herder/server.scm | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/nar-herder/server.scm b/nar-herder/server.scm index b3c50b6..50bc70f 100644 --- a/nar-herder/server.scm +++ b/nar-herder/server.scm @@ -21,6 +21,7 @@ #:use-module (srfi srfi-11) #:use-module (srfi srfi-34) #:use-module (srfi srfi-71) + #:use-module (ice-9 iconv) #:use-module (ice-9 match) #:use-module (ice-9 threads) #:use-module (ice-9 binary-ports) @@ -56,10 +57,13 @@ (values (build-response #:code code #:headers (append extra-headers - '((content-type . (application/json)) + '((content-type . (application/json + (charset . "utf-8"))) (vary . (accept))))) - (lambda (port) - (scm->json json port)))) + (call-with-encoded-output-string + "utf-8" + (lambda (port) + (scm->json json port))))) (define (parse-query-string query) (let lp ((lst (map uri-decode (string-split query (char-set #\& #\=))))) |