If the input text contains confusable Unicode characters, it returns True.
If no confusable characters are encountered in the input, or the
string does not contain any characters, the method returns False.
The IsConfusable method checks whether the input text contains
Unicode characters that may be visually confused with common Latin letters,
digits, or symbols. These characters are often used in phishing, obfuscation,
or evasion attacks by mimicking familiar text using characters from other
scripts (e.g., Cyrillic, Greek) or stylistic variants (e.g., fullwidth or
mathematical alphanumerics).
For example, a domain name such as paypal.com using the
Cyrillic 'p' and 'a' characters may appear visually identical to
paypal.com, but represent a different string entirely.
This method detects the presence of such characters by comparing each
Unicode code point against an internal map of known homoglyphs.
This method can be used to flag suspicious input, enforce stricter
character policies, or warn users about potentially deceptive content.
It does not modify the string or perform normalization. If
normalization is required, use the FilterUnicode method.
This method is deliberately biased toward security and may return
false positives when applied to text containing legitimate non-Latin
characters. It is intended for use on text that is expected to contain
only printable plaintext characters such as identifiers, URLs and file
paths. For example, it will return True if the text contains certain
Greek or Cyrillic characters that could be used to spoof ASCII letters
or URL delimiters. While this helps detect obfuscated or malicious
content, it can also flag legitimate text that appears in a
normal message or document.