* lisp/net/puny.el (puny-encode-string): Normalize before encoding
(bug#51954).
"Encode STRING according to the IDNA/punycode algorithm.
This is used to encode non-ASCII domain names.
For instance, \"bücher\" => \"xn--bcher-kva\"."
+ (setq string (downcase (string-glyph-compose string)))
(let ((ascii (seq-filter (lambda (char)
(< char 128))
string)))
;; Only allowed in unrestricted.
(should-not (puny-highly-restrictive-domain-p "I♥NY.org")))
+(ert-deftest puny-normalize ()
+ (should (equal (puny-encode-string (string-glyph-compose "Bä.com"))
+ "xn--b.com-gra"))
+ (should (equal (puny-encode-string "Bä.com")
+ "xn--b.com-gra"))
+ (should (equal (puny-encode-string "Bä.com") "xn--b.com-gra")))
+
;;; puny-tests.el ends here