GNU bug report logs - #69381
mumi does not correctly display (some?) non-ascii characters

Previous Next

Package: mumi;

Reported by: Tomas Volf <~@wolfsden.cz>

Date: Sun, 25 Feb 2024 13:27:03 UTC

Severity: normal

Tags: patch

Done: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #15 received at 69381 <at> debbugs.gnu.org (full text, mbox):

From: noe <at> xn--no-cja.eu
To: 69381 <at> debbugs.gnu.org
Cc: Noé Lopez <noelopez <at> free.fr>
Subject: [PATCH] web: Use string to avoid losing unicode characters.
Date: Sat,  2 Nov 2024 01:07:28 +0100
From: Noé Lopez <noelopez <at> free.fr>

I don’t really understand why the unicode characters were lost in the
first place, maybe something in the sanitize-response of (fibers web
server)?  Specifically, strings and procedures don’t take the same
path there.

* mumi/web/render.scm (render-html): Return string instead of procedure.
---
 mumi/web/render.scm | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/mumi/web/render.scm b/mumi/web/render.scm
index 168f3bc..c28a26f 100644
--- a/mumi/web/render.scm
+++ b/mumi/web/render.scm
@@ -105,8 +105,9 @@
 (define* (render-html sxml #:key (extra-headers '()))
   (values (append extra-headers
                   '((content-type . (text/html (charset . "utf-8")))))
-          (lambda (port)
-            (sxml->html sxml port))))
+          (call-with-output-string
+	    (lambda (port)
+              (sxml->html sxml port)))))
 
 (define (render-json json)
   (values '((content-type . (application/json)))
-- 
2.46.0





This bug report was last modified 101 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.