From bcf5b2d4b8a024ecaba84c13b61e73f382dbe24a Mon Sep 17 00:00:00 2001 From: Bram Matthys Date: Wed, 22 Sep 2021 09:42:08 +0200 Subject: [PATCH] Add support for arabic-utf8 in set::allowed-nickchars. Supplied by Sensiva in https://bugs.unrealircd.org/view.php?id=3734 --- src/modules/charsys.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/modules/charsys.c b/src/modules/charsys.c index 88256cac8..0187e367b 100644 --- a/src/modules/charsys.c +++ b/src/modules/charsys.c @@ -84,6 +84,7 @@ struct LangList /* MUST be alphabetized (first column) */ static LangList langlist[] = { /* { "arabic", "ara", LANGAV_ASCII|LANGAV_ISO8859_6 }, -- TODO: check if this has issues first! */ + { "arabic-utf8", "ara-utf8", LANGAV_ASCII|LANGAV_UTF8|LANGAV_LATIN_UTF8 }, { "belarussian-utf8", "blr-utf8", LANGAV_ASCII|LANGAV_UTF8|LANGAV_CYRILLIC_UTF8 }, { "belarussian-w1251", "blr", LANGAV_ASCII|LANGAV_W1251 }, { "catalan", "cat", LANGAV_ASCII|LANGAV_LATIN1 }, @@ -1181,6 +1182,19 @@ void charsys_add_language(char *name) charsys_addmultibyterange(0xc5, 0xc5, 0xaa, 0xab); charsys_addmultibyterange(0xc5, 0xc5, 0xbd, 0xbe); } + + /* [ARABIC] */ + if (latin_utf8 || !strcmp(name, "arabic-utf8")) + { + /* Supplied by Sensiva */ + /*charsys_addallowed("اأإآءبتثجحخدذرزسشصضطظعغفقكلمنهؤةويىئ");*/ + /*- From U+0621 to U+063A (Regex: [\u0621-\u063A])*/ + /* 0xd8a1 - 0xd8ba */ + charsys_addmultibyterange(0xd8, 0xd8, 0xa1, 0xba); + /*- From U+0641 to U+064A (Regex: [\u0641-\u064A])*/ + /* 0xd981 - 0xd98a */ + charsys_addmultibyterange(0xd9, 0xd9, 0x81, 0x8a); + } } /** This displays all the nick characters that are permitted */