From: Ivan Shmakov Date: Sat, 10 Jan 2015 16:48:38 +0000 (+0100) Subject: (shr-urlify): Decode URLs before using them as titles X-Git-Tag: emacs-25.0.90~2605^2~8 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=fd6b7e5807c521b011896d3a62c02330d8c9d3d4;p=emacs.git (shr-urlify): Decode URLs before using them as titles Fixes: debbugs:19555 * lisp/net/shr.el (shr-urlify): Decode URLs before using them as titles. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6c67f4ea600..5bebd09b15b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2015-01-10 Ivan Shmakov + + * net/shr.el (shr-urlify): Decode URLs before using them as titles + (bug#19555). + 2015-01-10 Lars Magne Ingebrigtsen * net/eww.el (eww): Always interpret URLs that start with https?: diff --git a/lisp/net/shr.el b/lisp/net/shr.el index ed824cf3fb2..a2bad81ee44 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -894,7 +894,13 @@ START, and END. Note that START and END should be markers." (add-text-properties start (point) (list 'shr-url url - 'help-echo (if title (shr-fold-text (format "%s (%s)" url title)) url) + 'help-echo (let ((iri (or (with-demoted-errors + "shr-urlify: %s" + (decode-coding-string + (url-unhex-string url) + 'utf-8 t)) + url))) + (if title (format "%s (%s)" iri title) iri)) 'follow-link t 'mouse-face 'highlight 'keymap shr-map)))