From: F. Jason Park Date: Mon, 1 Mar 2021 13:04:39 +0000 (+0100) Subject: Fix Bootstring skew parameter in puny.el X-Git-Tag: emacs-28.0.90~3483 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=eb2a1e1d6c813156cbaa835bde29499f7605ea08;p=emacs.git Fix Bootstring skew parameter in puny.el * lisp/net/puny.el: change puny-skew to match value given in RFC3492. * test/lisp/net/puny-tests.el (puny-test-encode-domain) (puny-test-decode-domain): add regression case for popular domain. (bug#46838). --- diff --git a/lisp/net/puny.el b/lisp/net/puny.el index 6b3663a5fb2..1cdefc08f02 100644 --- a/lisp/net/puny.el +++ b/lisp/net/puny.el @@ -75,7 +75,7 @@ For instance \"xn--bcher-kva\" => \"bücher\"." (defconst puny-damp 700) (defconst puny-tmin 1) (defconst puny-tmax 26) -(defconst puny-skew 28) +(defconst puny-skew 38) ;; 0-25 a-z ;; 26-36 0-9 diff --git a/test/lisp/net/puny-tests.el b/test/lisp/net/puny-tests.el index b37168f5ca7..28c0d49cbee 100644 --- a/test/lisp/net/puny-tests.el +++ b/test/lisp/net/puny-tests.el @@ -39,10 +39,12 @@ (should (string= (puny-decode-string "xn--9dbdkw") "חנוך"))) (ert-deftest puny-test-encode-domain () - (should (string= (puny-encode-domain "åäö.se") "xn--4cab6c.se"))) + (should (string= (puny-encode-domain "åäö.se") "xn--4cab6c.se")) + (should (string= (puny-encode-domain "яндекс.рф") "xn--d1acpjx3f.xn--p1ai"))) (ert-deftest puny-test-decode-domain () - (should (string= (puny-decode-domain "xn--4cab6c.se") "åäö.se"))) + (should (string= (puny-decode-domain "xn--4cab6c.se") "åäö.se")) + (should (string= (puny-decode-domain "xn--d1acpjx3f.xn--p1ai") "яндекс.рф"))) (ert-deftest puny-highly-restrictive-domain-p () (should (puny-highly-restrictive-domain-p "foo.bar.org"))