aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/net/idna.el4
1 files changed, 3 insertions, 1 deletions
diff --git a/lisp/net/idna.el b/lisp/net/idna.el
index f34fb9c490a..dfaf711c71e 100644
--- a/lisp/net/idna.el
+++ b/lisp/net/idna.el
@@ -33,7 +33,9 @@
33 (let ((ascii (seq-filter (lambda (char) 33 (let ((ascii (seq-filter (lambda (char)
34 (< char 128)) 34 (< char 128))
35 string))) 35 string)))
36 (concat "xn--" ascii "-" (idna-encode-complex (length ascii) string)))) 36 (if (= (length ascii) (length string))
37 string
38 (concat "xn--" ascii "-" (idna-encode-complex (length ascii) string)))))
37 39
38(defconst idna-initial-n 128) 40(defconst idna-initial-n 128)
39(defconst idna-initial-bias 72) 41(defconst idna-initial-bias 72)