From: Lars Ingebrigtsen Date: Mon, 28 Dec 2015 23:07:50 +0000 (+0100) Subject: Fix puny-encoding all-non-ASCII domains X-Git-Tag: emacs-26.0.90~2834 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=341feb3a26a0277f535217f4919b23eb70e3680e;p=emacs.git Fix puny-encoding all-non-ASCII domains * puny.el (puny-encode-string): Fix the all-non-ASCII encoding case. --- diff --git a/lisp/net/puny.el b/lisp/net/puny.el index a16e3a07706..d96c6c22196 100644 --- a/lisp/net/puny.el +++ b/lisp/net/puny.el @@ -47,7 +47,11 @@ For instance, \"bücher\" => \"xn--bcher-kva\"." string))) (if (= (length ascii) (length string)) string - (concat "xn--" ascii "-" (puny-encode-complex (length ascii) string))))) + (concat "xn--" + (if (null ascii) + "" + (concat ascii "-")) + (puny-encode-complex (length ascii) string))))) (defun puny-decode-domain (domain) "Decode DOMAIN according to the IDNA/punycode algorith.