emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/hyperdrive cbe2a28041 03/26: Fix: (h/write) Encode metadat


From: ELPA Syncer
Subject: [nongnu] elpa/hyperdrive cbe2a28041 03/26: Fix: (h/write) Encode metadata JSON as UTF-8
Date: Fri, 30 Aug 2024 16:00:07 -0400 (EDT)

branch: elpa/hyperdrive
commit cbe2a28041c0a98eff6726fdb11698bb05257877
Author: Joseph Turner <joseph@ushin.org>
Commit: Joseph Turner <joseph@ushin.org>

    Fix: (h/write) Encode metadata JSON as UTF-8
    
    Previously, the JSON object was uploaded with the internal Emacs
    representation.
---
 hyperdrive-lib.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/hyperdrive-lib.el b/hyperdrive-lib.el
index 8300034c35..756db45326 100644
--- a/hyperdrive-lib.el
+++ b/hyperdrive-lib.el
@@ -1325,7 +1325,9 @@ DEFAULT and INITIAL-INPUT are passed to `read-string' 
as-is."
   (declare (indent defun))
   (let ((entry (he/create :hyperdrive hyperdrive
                           :path "/.well-known/host-meta.json")))
-    (h/write entry :body (json-encode (h/metadata hyperdrive))
+    ;; TODO: Is it okay to always encode the JSON object as UTF-8?
+    (h/write entry :body (encode-coding-string
+                          (json-encode (h/metadata hyperdrive)) 'utf-8)
       :then then)
     hyperdrive))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]