branch: externals/embark
commit 19a13e344e04bbf861eaa74491b23da52b398672
Author: Omar Antolín Camarena <[email protected]>
Commit: Omar Antolín Camarena <[email protected]>
Decode URI encoded URLs in UTF-8
Fixes #725.
---
embark.el | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/embark.el b/embark.el
index 7ced03ae8f..61b1f98af7 100644
--- a/embark.el
+++ b/embark.el
@@ -3982,9 +3982,13 @@ ALGORITHM is the hash algorithm symbol understood by
`secure-hash'."
(insert encoded)))
(defun embark-decode-url (start end)
- "Decode the URI-encoded region between START and END in current buffer."
+ "Decode the URI-encoded region between START and END in current buffer.
+It assumes the URL was encoded in UTF-8."
(interactive "r")
- (let ((decoded (url-unhex-string (buffer-substring-no-properties start
end))))
+ (let ((decoded (decode-coding-string
+ (url-unhex-string
+ (buffer-substring-no-properties start end))
+ 'utf-8)))
(delete-region start end)
(insert decoded)))