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

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: mumi; Reported by: Tomas Volf <~@wolfsden.cz>; Keywords: patch; dated Sun, 25 Feb 2024 13:27:03 UTC; Maintainer for mumi is bug-mumi@HIDDEN.
Added tag(s) patch. Request was from Felix Lechner <felix.lechner@HIDDEN> to control <at> debbugs.gnu.org. Full text available.
Added blocking bug(s) 70907 and 70906 Request was from Felix Lechner <felix.lechner@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 69381 <at> debbugs.gnu.org:


Received: (at 69381) by debbugs.gnu.org; 14 May 2024 23:13:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue May 14 19:13:22 2024
Received: from localhost ([127.0.0.1]:41549 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s71Kk-00010w-9d
	for submit <at> debbugs.gnu.org; Tue, 14 May 2024 19:13:22 -0400
Received: from sail-ipv4.us-core.com ([208.82.101.137]:45434)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <felix.lechner@HIDDEN>) id 1s71Kf-00010n-62
 for 69381 <at> debbugs.gnu.org; Tue, 14 May 2024 19:13:20 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=2017; bh=MxeHZHe/XILKnAa
 imE2YqfFjMMmI3L4PdH4MsWmW7f0=; h=date:subject:cc:to:from;
 d=lease-up.com; b=m/rujQsKl7HdvG7O5801TGGyOeBVAzBfT2tRsZz8BfVBXO1ig2Bx
 dTXLoJVYAeXjX6ffk3tmeoncVfmZZaMXhQ0+eQugHvLNG2wjoEzLnNw7dLAJDO3WgIe7jH
 i9nI1GkEK3LhT6z0JG298G+j2soZOHwO6xG+gyNlxgK501BYc=
Received: by localhost (OpenSMTPD) with ESMTPA id e8f248be
 for <69381 <at> debbugs.gnu.org>; Tue, 14 May 2024 23:13:14 +0000 (UTC)
Delivered-To: 69381@HIDDEN
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=2017; bh=MxeHZHe/XILKnAa
 imE2YqfFjMMmI3L4PdH4MsWmW7f0=; h=date:subject:cc:to:from;
 d=lease-up.com; b=m/rujQsKl7HdvG7O5801TGGyOeBVAzBfT2tRsZz8BfVBXO1ig2Bx
 dTXLoJVYAeXjX6ffk3tmeoncVfmZZaMXhQ0+eQugHvLNG2wjoEzLnNw7dLAJDO3WgIe7jH
 i9nI1GkEK3LhT6z0JG298G+j2soZOHwO6xG+gyNlxgK501BYc=
Received: by sail-ipv4.us-core.com (OpenSMTPD) with ESMTPSA id b9008797
 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); 
 Tue, 14 May 2024 23:13:14 +0000 (UTC)
Received: from localhost (localhost [local])
 by localhost (OpenSMTPD) with ESMTPA id 66a71495;
 Tue, 14 May 2024 23:13:13 +0000 (UTC)
From: Felix Lechner <felix.lechner@HIDDEN>
To: 69381@HIDDEN
Subject: [PATCH] Convert HTML to UTF-8 ourselves. (Closes: #69381)
Date: Tue, 14 May 2024 16:12:49 -0700
Message-ID: <20240514231249.18303-1-felix.lechner@HIDDEN>
X-Mailer: git-send-email 2.41.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.3 (/)
X-Debbugs-Envelope-To: 69381
Cc: Tomas Volf <~@wolfsden.cz>, Felix Lechner <felix.lechner@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

This fixes a host of encoding issues in Mumi, including the diff
problems that are not mentioned in the bug.  An example is here:

    https://issues.guix.gnu.org/63508#4

The procedure version may one day be more efficient but does not work.
Based on comments in the Guile source code, the procedure style may
one day enable more advanced response formats.  The author is unclear
as to why the procedure does not work.  There may be a complex
interaction involving the response headers.

A preview of this code is live at patchwise.org.

The solution of this bug may depend on the patch in Bug#70907.  This
patch furthermore depends on the patch in Bug#70906, but the solution
of the bug may not.
---
 mumi/web/render.scm | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/mumi/web/render.scm b/mumi/web/render.scm
index 316ca4c..9b16f8d 100644
--- a/mumi/web/render.scm
+++ b/mumi/web/render.scm
@@ -28,6 +28,7 @@
   #:use-module ((ice-9 textual-ports)
                 #:select (get-string-all put-string))
   #:use-module (ice-9 match)
+  #:use-module (rnrs bytevectors)
   #:use-module (web http)
   #:use-module (web request)
   #:use-module (web response)
@@ -104,13 +105,13 @@
 (define* (render-html sxml #:key (extra-headers '()))
   (values (append extra-headers
                   '((content-type . (text/html (charset . "utf-8")))))
-          (lambda (port)
-            (sxml->html sxml port))))
+          (string->utf8
+           (sxml->html-string sxml))))
 
 (define (render-json json)
   (values '((content-type . (application/json (charset . "utf-8"))))
-          (lambda (port)
-            (scm->json json port))))
+          (string->utf8
+           (scm->json-string json))))
 
 (define (not-found uri)
   (values (build-response #:code 404)
-- 
2.41.0





Information forwarded to bug-mumi@HIDDEN:
bug#69381; Package mumi. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 25 Feb 2024 13:26:54 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Feb 25 08:26:54 2024
Received: from localhost ([127.0.0.1]:44810 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1reEWr-0005k0-PK
	for submit <at> debbugs.gnu.org; Sun, 25 Feb 2024 08:26:54 -0500
Received: from lists.gnu.org ([209.51.188.17]:47118)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <~@wolfsden.cz>) id 1reEWp-0005je-8q
 for submit <at> debbugs.gnu.org; Sun, 25 Feb 2024 08:26:51 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <~@wolfsden.cz>) id 1reEB3-00045w-MW
 for bug-mumi@HIDDEN; Sun, 25 Feb 2024 08:04:21 -0500
Received: from wolfsden.cz ([37.205.8.62])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <~@wolfsden.cz>) id 1reEAy-0007Na-0w
 for bug-mumi@HIDDEN; Sun, 25 Feb 2024 08:04:20 -0500
Received: by wolfsden.cz (Postfix, from userid 104)
 id 88A95272361; Sun, 25 Feb 2024 13:04:11 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail;
 t=1708866251; bh=rDNHDRQNnoxWXsQsDbp+D/E9LZCnXQqlcybrD6QDFZw=;
 h=Date:From:To:Subject;
 b=DSv9jlOwX8AWiFSEc8Hs7jMXxlWkBi1qF/wNnwjp1hONherD1wFcjmj49nLrcxZb0
 KPu3QMxChw0OJz1gEG6b6CXx7pyxeTtNInrJQy6s9Q13Fg07xc1SbDqMCj3VJd7hVj
 vFybYtCjc8jsmtLLU+Hqcmr9a6O2J3dFF665m9CtiQ+CiwOAnEPpazJgEjcKJbaTwe
 Z1hc3kE3Oue++QlfrHgRwHtBoPyLlPjxnUV1p8MRKsxwJyVZJ0FCyMjw5OJYjWVgg+
 L+mdFv22wdjLl+G24wAr46iFH9UB5XKQlS0JnS0EsaQv5xQ8O+XtrweaHW56bG4eqR
 Gu9rDuO0FVnPSN2xUzxg2SpNpnT5qeXJmMCGbAP5beb0//qgNNDIj2EDDUJ22PUUPb
 YFVVgoKZpbqooKrDnoKcPyPOMLyYDwiz2xagp5RNDUEfO1tpJ36xLaByVBCvYiAGIC
 dFXjP4kLK03H0ZVGKBWlLOLpVbs2/ULU3Fcs+VCWz0UcgsknwEcZJ2suDm7a5SzBA/
 Do3cH753sYIKyZvPg4ghl6lKjEBq0hwj5bM4aDioM9c+aDPbuK7vyifm8h9ktc38l2
 bUce8H7tOMYdFrXCjwLnVDr0GD/cRbkw0qPLYmdK7my0aYgKqgwaMiPlhRC88wg6GF
 +XkpheIZmLTlgTWONvwR8ID8=
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on wolfsden
X-Spam-Level: 
X-Spam-Status: No, score=-1.2 required=5.0 tests=ALL_TRUSTED,DKIM_SIGNED,
 DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,T_SCC_BODY_TEXT_LINE,
 URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6
Received: from localhost (unknown [193.32.127.144])
 by wolfsden.cz (Postfix) with ESMTPSA id A732627145E
 for <bug-mumi@HIDDEN>; Sun, 25 Feb 2024 13:04:10 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail;
 t=1708866250; bh=rDNHDRQNnoxWXsQsDbp+D/E9LZCnXQqlcybrD6QDFZw=;
 h=Date:From:To:Subject;
 b=anIRjgz/Se13avsIiBcvHiu88hRjWerJHT8DsR1kUHoECBiYoyCX26otEZLOqbAnc
 VLwERKd2Yc4PK9pgxYyb6Jy0jiFDG2AGhGaVUn1jj+WbAatIZJrOeMATLh+5MVVzt5
 oSzw77pKZpa96vRaRpJj4ANSDBFOOeBDrfxt+vIwZm/VpnLQrJzB1w67xhOv0q3Nuv
 0O7xyyC78LO10G+cDyxiWeIvDbwB1Na3wtIdNll1wp9yPYOHLPPmShD/VSYetHfggv
 sVP/pRUJn6+jSva/bGeVEFIsdbvlr0o3K9qTH1kMmoClKZJWG8OzY+KPZFO/2IFIbb
 62poA9owb+9+7rly7THgoEVd3oD0ar8hLWKf/Ri0zfLxpHNFz1m6258jy4Fszxuo5S
 Y0bX8RzLTzXViYEQk0TwrHpT8B9qBcaqlA8iWt4anMBFAEwUhnhF1S7dWrM3iT5p/f
 p5vu+9ExIZXWukxIIEk5KvZzns65GMkL38034d9s5NqCkYAeFG2Y9Q+FswuMvWq/83
 FF0MH/j4xpGnMIrJa3CQb4PbXH8hJV+ugQ96QDmNSYRe76c9WUBzAzcZE+vrFSIK75
 CQn4YO0fiAvQNW2NChLQDsvylTnUKanyGTAu2TKSaDOWDuArElbfDeykqhV9szme55
 S6ynrJh/jVjBj0wgMk+mfL9I=
Date: Sun, 25 Feb 2024 14:04:10 +0100
From: Tomas Volf <~@wolfsden.cz>
To: bug-mumi@HIDDEN
Subject: mumi does not correctly display (some?) non-ascii characters
Message-ID: <Zds6yhPkZ0Id6SAT@ws>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha512;
 protocol="application/pgp-signature"; boundary="CBmq/bXiaLg1Go6W"
Content-Disposition: inline
Received-SPF: pass client-ip=37.205.8.62; envelope-from=~@wolfsden.cz;
 helo=wolfsden.cz
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001,
 SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)


--CBmq/bXiaLg1Go6W
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hi,

when I compare mumi page[0] with debbugs page[1], the from field displays "=
???"
in mumi, but "=E5=AE=8B=E6=96=87=E6=AD=A6" in debbugs.

Have a nice day,
Tomas Volf

0: https://issues.guix.gnu.org/57268
1: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D57268

--
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.

--CBmq/bXiaLg1Go6W
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEt4NJs4wUfTYpiGikL7/ufbZ/wakFAmXbOsoACgkQL7/ufbZ/
wanbRxAApKKRUtO29oBTdcr2QO99NNsvW2cq5VWAm4iAKEaThMzZneIT5ljX7WHi
qMjAJq4wBJMzRiZpym51Z/ZVJQ4l7AW7fZmzmjcMp7f66WxG1Ob6B5815lE4Iyyv
8Zo+3UBBLOuCfk0zXgWiO/5DhL0XeLs2FqHvdKOlfI++eNjPwuTLY8wxyk1oB31Z
njJyqXZdpxKa4Z54tyv2JIs2FWAptYAR2MXFTmoEmV4RanNDBXOvYfc84XBFaGE0
ObhK0Nn0pjxmZjzR7XIVvnm4Q6krpmSGd/Pqhe4JTLoeFnl2QV27fKExxGtKw8fm
fR1HTPBQ5+XvfiJ4atVhYsoE7gAH2KW+Db2tm0Wp0S3kqibVndQF2jjZxkuaYvqG
Rdqi4krCZMkDzP8i9fapXyJ9FPo60qYHttpl98HLMt/utL2iNV6sDULH/cv0senR
P1Pdk4n/NzPnbiDskkVGc+FkoZVTkhFEDJbrfAQ8GF7hmktMpXZFpbP0BypMVKz6
aoT6czUisgSXzWtT+rm3LMgjIqPd+JHm9IeEDsZ6KCO7W5mpqwXGK0qB7x6OgJ3S
B33GiqattHNeWlWkGOEs/Ptz9AbWbX8oUaiMZ7UhAyBzCpnaZtXbU9CHf6k3MFGY
z1PgvDtqXfqkMfVNGzzI3NLUjqdDtZOm3EUN5l1WE57Yhze7ESI=
=2/8p
-----END PGP SIGNATURE-----

--CBmq/bXiaLg1Go6W--




Acknowledgement sent to Tomas Volf <~@wolfsden.cz>:
New bug report received and forwarded. Copy sent to bug-mumi@HIDDEN. Full text available.
Report forwarded to bug-mumi@HIDDEN:
bug#69381; Package mumi. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Tue, 14 May 2024 23:30:02 UTC

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