Getting a unicode scalar count should give the expected result:
let myString = "هنالك العديد من الأنواع المتوفرة لنصوص لوريم إيبسوم، ولكن الغالبية تم تعديلها بشكل ما عبر إدخال بعض النوادر أو الكلمات العشوائية إلى النص. إن كنت تريد أن تستخدم نص لوريم إيبسوم ما، عليك أن تتحقق أولاً أن ليس هناك أي كلمات أو عبارات محرجة أو غير لائقة مخبأة في هذا النص. بينما تعمل جميع مولّدات نصوص ا" myString.unicodeScalars.count المتوفرة لنصوص لوريم إيبسوم, ولكن الغالبية تم تعديلها بشكل ما عبر إدخال بعض النوادر أو الكلمات العشوائية إلى النص. إن كنت تريد أن تستخدم نص لوريم إيبسوم ما, عليك أن تتحقق أولا أن ليس هناك أي كلمات أو عبارات let myString = "هنالك العديد من الأنواع المتوفرة لنصوص لوريم إيبسوم، ولكن الغالبية تم تعديلها بشكل ما عبر إدخال بعض النوادر أو الكلمات العشوائية إلى النص. إن كنت تريد أن تستخدم نص لوريم إيبسوم ما، عليك أن تتحقق أولاً أن ليس هناك أي كلمات أو عبارات محرجة أو غير لائقة مخبأة في هذا النص. بينما تعمل جميع مولّدات نصوص ا" myString.unicodeScalars.count
As mentioned in Swift - Strings and characters :
Behind the scenes, the string type Swifts is built from Unicode scalar values . A Unicode scanner is a unique 21-bit number for a character or modifier, such as U + 0061 for LATIN SMALL LETTER A ("a"), or U + 1F425 for FRONT-FACING BABY CHICK ("🐥").
but
No matter what result you expect, counting the "character" (delimiters) such as "Fat-ha", "damma", "kasra" as a split character, probably gives the wrong result .
For example: if you tried to check the number of words "أولا", you will notice that:
let myString = "أولاً" myString.characters.count
as you can see, the TanweenFat-ha character is not considered a separate character unless you consider its unicodeScalars value.
As you already mentioned, it seems that charactercountonline.com considers " character " (delimiters) to be independent characters, which should be logical for people who do not speak Arabic, but that would be a wrong count.
Note For non-Arab speaking speakers:
The word "أولا" contains a decimal separator called "Fat-hatan" or "Tanween Fat-h", this separator should not be considered as a separate character related to Arabic grammars; The purpose of its use is to indicate how the word should be written. This logic should be obvious to people who speak Arabic that the word "أولا" contains four characters, but not computers, when it is associated with counting!