aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/net/puny.el12
1 files changed, 11 insertions, 1 deletions
diff --git a/lisp/net/puny.el b/lisp/net/puny.el
index ac47e13c97d..f2fa3464348 100644
--- a/lisp/net/puny.el
+++ b/lisp/net/puny.el
@@ -193,7 +193,12 @@ For instance \"xn--bcher-kva\" => \"bücher\"."
193;; http://www.unicode.org/reports/tr39/#Restriction_Level_Detection 193;; http://www.unicode.org/reports/tr39/#Restriction_Level_Detection
194;; http://www.unicode.org/reports/tr31/#Table_Candidate_Characters_for_Inclusion_in_Identifiers 194;; http://www.unicode.org/reports/tr31/#Table_Candidate_Characters_for_Inclusion_in_Identifiers
195 195
196(defun puny-highly-restrictive-p (string) 196(defun puny-highly-restrictive-string-p (string)
197 "Say whether STRING is \"highly restrictive\" in the Unicode IDNA sense.
198See http://www.unicode.org/reports/tr39/#Restriction_Level_Detection
199for details. The main idea is that if you're mixing
200scripts (like latin and cyrillic), you may confuse the user by
201using homographs."
197 (let ((scripts 202 (let ((scripts
198 (delq 203 (delq
199 t 204 t
@@ -233,6 +238,11 @@ For instance \"xn--bcher-kva\" => \"bücher\"."
233 (latin han bopomofo) 238 (latin han bopomofo)
234 (latin han hangul))))))) 239 (latin han hangul)))))))
235 240
241(defun puny-highly-restrictive-domain-p (domain)
242 "Say whether DOMAIN is \"highly restrictive\" in the Unicode IDNA sense.
243See `puny-highly-restrictive-string-p' for further details."
244 (seq-every-p 'puny-highly-restrictive-string-p (split-string domain "[.]")))
245
236(provide 'puny) 246(provide 'puny)
237 247
238;;; puny.el ends here 248;;; puny.el ends here