branch: elpa/mastodon commit 4b676a4ba480b6dba90f1bb91251d5f425c9a1c4 Author: marty hiatt <martianhia...@disroot.org> Commit: marty hiatt <martianhia...@disroot.org>
Revert "strip some evil unicode chars from incoming JSON. #718." This reverts commit 1fc7ba947b2391053a0a93cd454949b366598ee6. --- lisp/mastodon-http.el | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/lisp/mastodon-http.el b/lisp/mastodon-http.el index 8e6e8c1d29..a91f272dd4 100644 --- a/lisp/mastodon-http.el +++ b/lisp/mastodon-http.el @@ -205,7 +205,6 @@ STRING should be a HTML for a 404 errror." (shr-render-buffer (current-buffer)) (view-mode))) ; for 'q' to kill buffer and window ;; (error ""))) ; stop subsequent processing -;; (error ""))) ; stop subsequent processing (defun mastodon-http--process-response (&optional no-headers vector) "Process http response. @@ -220,14 +219,11 @@ Callback to `mastodon-http--get-response-async', usually (mastodon-http--process-headers)))) (goto-char (point-min)) (re-search-forward "^$" nil 'move) - (let* ((json-array-type (if vector 'vector 'list)) - (substr (buffer-substring-no-properties (point) (point-max))) - ;; strip evil unicode chars: - ;; FIXME: this should probably be done better than this but oh well: - (json-str (replace-regexp-in-string mastodon-http--evil-unicode-regex - "" substr)) - (json-string (string-trim-right - (decode-coding-string json-str 'utf-8)))) + (let ((json-array-type (if vector 'vector 'list)) + (json-string (string-trim-right + (decode-coding-string + (buffer-substring-no-properties (point) (point-max)) + 'utf-8)))) (kill-buffer) (cond ((or (string-empty-p json-string) (null json-string)) nil)