branch: elpa/fedi
commit c1ac42bb98fc40913945127eeecc8d7032f5c6ed
Author: marty hiatt <[email protected]>
Commit: marty hiatt <[email protected]>

    http - post/patch/put - encode-coding-str wrap
    
    see e.g.
    
https://github.com/alphapapa/matrix-client.el/commit/d3b0233ffb555a8d01bdafcfbe24d6c96b1dab1d
---
 fedi-http.el | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/fedi-http.el b/fedi-http.el
index a4de03439d8..39ff214c0a2 100644
--- a/fedi-http.el
+++ b/fedi-http.el
@@ -153,7 +153,8 @@ json-string PARAMS."
   (let* ((url-request-data
           (when params
             (if json
-                (json-encode params)
+                (encode-coding-string
+                 (json-encode params) 'utf-8)
               (fedi-http--build-params-string params))))
          ;; TODO: perhaps leave these headers to the package now that
          ;; `fedi-request' takes header args?
@@ -283,7 +284,8 @@ If JSON, encode params as JSON."
   (let* ((url-request-data
           (when params
             (if json
-                (json-encode params)
+                (encode-coding-string
+                 (json-encode params) 'utf-8)
               (fedi-http--build-params-string params))))
          (headers (when json
                     (append headers
@@ -307,7 +309,8 @@ Optionally specify the PARAMS to send."
   (let* ((url-request-data
           (when params
             (if json
-                (json-encode params)
+                (encode-coding-string
+                 (json-encode params) 'utf-8)
               (fedi-http--build-params-string params))))
          ;; (url (fedi-http--concat-params-to-url base-url params)))))
          (headers (when json

Reply via email to