Fix puny-encoding all-non-ASCII domains

* puny.el (puny-encode-string): Fix the all-non-ASCII encoding case.
This commit is contained in:
Lars Ingebrigtsen 2015-12-29 00:07:50 +01:00
parent 1efc5f8b09
commit 341feb3a26

View file

@ -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.