IsConfusable Method  
 

Determines if a string contains confusable Unicode characters.

Syntax

object.IsConfusable( InputText )

Parameters

InputText
A variant type which may specify either a string or byte array. If a string type is passed to this method, it will be checked for confusable characters as-is. If a byte array is passed to this method, the input will be processed as UTF-8 encoded text and checked for confusable characters. No other data types are accepted by this method and an exception will be thrown if an invalid data type is provided as the input text.

Return Value

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.

Remarks

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.

See Also

FilterHtml, FilterUnicode, StrToUtf8 Method, Utf8ToStr Method