Transform non-restrictive domains to punycode for display

* lisp/net/eww.el (eww): Check whether the domain is Highly
Restrictive in the Unicode IDNA sense.
parent d259328f
......@@ -275,6 +275,13 @@ word(s) will be searched for via `eww-search-prefix'."
(setq url (concat eww-search-prefix
(replace-regexp-in-string " " "+" url))))))
;; Check whether the domain only uses "Highly Restricted" Unicode
;; IDNA characters. If not, transform to punycode to indicate that
;; there may be funny business going on.
(let ((parsed (url-generic-parse-url url)))
(unless (puny-highly-restrictive-p (url-host parsed))
(setf (url-host parsed) (puny-encode-domain (url-host parsed)))
(setq url (url-recreate-url parsed))))
(plist-put eww-data :url url)
(plist-put eww-data :title "")
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment