From fd6b7e5807c521b011896d3a62c02330d8c9d3d4 Mon Sep 17 00:00:00 2001 From: Ivan Shmakov Date: Sat, 10 Jan 2015 17:48:38 +0100 Subject: [PATCH] (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. --- lisp/ChangeLog | 5 +++++ lisp/net/shr.el | 8 +++++++- 2 files changed, 12 insertions(+), 1 deletion(-) 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))) -- 2.39.2