From 19fefea1ca567cc08c67a2167f8e366483b1c013 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Tue, 18 Jan 2022 09:57:43 +0100 Subject: Add textsec support for confusable characters * admin/notes/unicode: Note the confusables.txt file. * admin/unidata/Makefile.in (${unidir}/uni-confusable.el): Generate the confusable file. * admin/unidata/README (https): Add confusables.txt. * admin/unidata/confusables.txt: New file. * admin/unidata/unidata-gen.el (unidata-gen-confusable): Parse the confusables.txt file. * lisp/international/textsec.el (textsec-ascii-confusable-p) (textsec-unconfuse-string): New functions. --- test/lisp/international/textsec-tests.el | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test/lisp/international/textsec-tests.el') diff --git a/test/lisp/international/textsec-tests.el b/test/lisp/international/textsec-tests.el index 3738545e073..50106bb955e 100644 --- a/test/lisp/international/textsec-tests.el +++ b/test/lisp/international/textsec-tests.el @@ -86,4 +86,11 @@ (should-not (textsec-mixed-numbers-p "8foo8")) (should (textsec-mixed-numbers-p "8foo৪"))) +(ert-deftest test-confusable () + (should (equal (textsec-unconfuse-string "ljeto") "ljeto")) + (should (textsec-ascii-confusable-p "ljeto")) + (should-not (textsec-ascii-confusable-p "ljeto")) + (should (equal (textsec-unconfuse-string "~") "〜")) + (should-not (textsec-ascii-confusable-p "~"))) + ;;; textsec-tests.el ends here -- cgit v1.2.3