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).
This commit is contained in:
F. Jason Park 2021-03-01 14:04:39 +01:00 committed by Lars Ingebrigtsen
parent 5684f7995d
commit eb2a1e1d6c
2 changed files with 5 additions and 3 deletions

View file

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

View file

@ -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"))