TextEncoding.IsValidData

From Xojo Documentation

Method

TextEncoding.IsValidData(Text As String) As Boolean

New in 2010r2

Supported for all project types and targets.

Checks to see whether the passed string is valid for that encoding.

Example

If Encodings.UTF8.IsValidData(myText) Then
// do whatever you want here...
End If