There are two versions of this function, IsUnicodeTextA
which checks a multi-byte string to ensure that it contains valid UTF-8
encoded text, and IsUnicodeTextW which checks a wide
string to ensure it contains valid UTF-16 text.
If the value of the nLength parameter is larger than the
number of characters in the string, the function will not check beyond
the terminating null character. If the length of the string is
unknown, specify a length of -1 and the function will check the entire
contents of the string up to the terminating null character.
If there is a byte order mark (BOM) sequence at the beginning of
the string, this will be recognized by the function. A string that
contains a valid BOM sequence with no corresponding text will be
successfully validated by this function.
This function does not perform checks to ensure the string contains
printable characters. It only validates that the Unicode string is
structurally valid. The IsUnicodeTextA function will
check to make sure there are no invalid UTF-8 encodings. The
IsUnicodeTextW function will check to make sure the UTF-16
string does not contain any unpaired surrogates.
This function does not preserve state information and cannot be
used to check the validity of a stream of text or binary data. It
should only be used to validate complete Unicode strings that are
terminated with a null character.