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

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

[elpa] externals/kiwix af10bd6 031/192: fix org link exporting encoding


From: Stefan Monnier
Subject: [elpa] externals/kiwix af10bd6 031/192: fix org link exporting encoding
Date: Sat, 19 Dec 2020 00:41:27 -0500 (EST)

branch: externals/kiwix
commit af10bd6d1932973897f2b533ea9b7772f3ae325d
Author: stardiviner <numbchild@gmail.com>
Commit: stardiviner <numbchild@gmail.com>

    fix org link exporting encoding
---
 kiwix.el | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/kiwix.el b/kiwix.el
index d38e4f0..0124a18 100644
--- a/kiwix.el
+++ b/kiwix.el
@@ -156,13 +156,15 @@ for query string and library interactively."
                  (match-string 1 link)))
          (library (when (string-match "\\(.+\\):(\\(.+\\)?):\\(.*\\)" link)
                     (match-string 2 link)))
-         (query (or description
-                    (when (string-match "\\(.+\\):(\\(.+\\)?):\\(.*\\)" link)
-                      (match-string 3 link))))
-         ;; "http://en.wikipedia.org/w/index.php?search=%s";
+         ;; query need to be convert to URL encoding: "禅宗" 
https://zh.wikipedia.org/wiki/%E7%A6%85%E5%AE%97
+         (query (url-encode-url
+                 (or description
+                     (when (string-match "\\(.+\\):(\\(.+\\)?):\\(.*\\)" link)
+                       (match-string 3 link)))))
+         ;; "http://en.wikipedia.org/wiki/Linux";
          ;;         --
          ;;          ^- library: en, zh
-         (path (concat "http://"; library ".wikipedia.org/w/index.php?search=" 
query))
+         (path (concat "http://"; library ".wikipedia.org/wiki/" query))
          (desc query))
     (when (stringp path)
       (cond



reply via email to

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