GNU bug report logs - #70906
[PATCH] Send HTTP headers with charset utf-8.

Previous Next

Package: mumi;

Reported by: Felix Lechner <felix.lechner <at> lease-up.com>

Date: Mon, 13 May 2024 04:39:02 UTC

Severity: normal

Tags: patch

Done: Arun Isaac <arunisaac <at> systemreboot.net>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 70906 in the body.
You can then email your comments to 70906 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-mumi <at> gnu.org:
bug#70906; Package mumi. (Mon, 13 May 2024 04:39:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Felix Lechner <felix.lechner <at> lease-up.com>:
New bug report received and forwarded. Copy sent to bug-mumi <at> gnu.org. (Mon, 13 May 2024 04:39:02 GMT) Full text and rfc822 format available.

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

From: Felix Lechner <felix.lechner <at> lease-up.com>
To: bug-mumi <at> gnu.org
Cc: Felix Lechner <felix.lechner <at> lease-up.com>
Subject: [PATCH] Send HTTP headers with charset utf-8.
Date: Sun, 12 May 2024 21:38:32 -0700
In most cases, providing HTTP headers with the charset is superior
to (and has precedence over) the declaration in an HTML <meta> tag:

    https://stackoverflow.com/a/26032993

A preview of this code is live at patchwise.org.
---
 mumi/web/render.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mumi/web/render.scm b/mumi/web/render.scm
index ad3ae0e..e867178 100644
--- a/mumi/web/render.scm
+++ b/mumi/web/render.scm
@@ -103,12 +103,12 @@
 
 (define* (render-html sxml #:key (extra-headers '()))
   (values (append extra-headers
-                  '((content-type . (text/html))))
+                  '((content-type . (text/html (charset . "utf-8")))))
           (lambda (port)
             (sxml->html sxml port))))
 
 (define (render-json json)
-  (values '((content-type . (application/json)))
+  (values '((content-type . (application/json (charset . "utf-8"))))
           (lambda (port)
             (scm->json json port))))
 

base-commit: 99416ed5c7d950eaf54d52023a2efd975bccac92
-- 
2.41.0





Added indication that bug 70906 blocks69381 Request was from Felix Lechner <felix.lechner <at> lease-up.com> to control <at> debbugs.gnu.org. (Tue, 14 May 2024 23:16:02 GMT) Full text and rfc822 format available.

Reply sent to Arun Isaac <arunisaac <at> systemreboot.net>:
You have taken responsibility. (Fri, 07 Jun 2024 22:44:02 GMT) Full text and rfc822 format available.

Notification sent to Felix Lechner <felix.lechner <at> lease-up.com>:
bug acknowledged by developer. (Fri, 07 Jun 2024 22:44:03 GMT) Full text and rfc822 format available.

Message #12 received at 70906-done <at> debbugs.gnu.org (full text, mbox):

From: Arun Isaac <arunisaac <at> systemreboot.net>
To: 70906-done <at> debbugs.gnu.org
Cc: Felix Lechner <felix.lechner <at> lease-up.com>
Subject: Re: [PATCH] Send HTTP headers with charset utf-8.
Date: Fri, 07 Jun 2024 23:43:03 +0100
Applied, thanks!

I made the following modifications:
- The application/json MIME type does not require a charset. See
https://stackoverflow.com/questions/9254891/what-does-content-type-application-json-charset-utf-8-really-mean
So, I dropped that part.
- I removed the Content-Type meta tag from the HTML.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 06 Jul 2024 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 20 days ago.

Previous Next


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