TextEncoding.IsValidData
From Xojo Documentation
Method
TextEncoding.IsValidData(Text As String) As Boolean
New in 2010r2
Supported for all project types and targets.
New in 2010r2
Supported for all project types and targets.
Checks to see whether the passed string is valid for that encoding.