Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.5d

Application v 5.25a

  

 

Chapter FiveGeneral Functions (continued)

CheckUTFCompliance Function

Overview

The CheckUTFCompliance function takes an 8-bit string and attempts to decode it as UTF-8.

Syntax/Parameters

Syntax

int = CheckUTFCompliance ( string data );

Parameters

data

A string containing text to test.

Return Value

Returns an int containing the result of the test. On failure, the last error code is set as ERROR_SYNTAX with the zero-based position of the character error in the lower part of the error. On no error, the return value will contain the number of Unicode characters that can be decoded in the data string.

Remarks

The function moves through the source data and decodes any UTF-8 sequences and counts the valid Unicode characters (characters above 0xC0). Characters between 0x80 and 0xC0 are not valid Unicode positions and if detected will cause the function to return an error.

CheckUTFCompliance can be used to check to see of a string has UTF character sequences by checking the return value as not an error but greater than zero.

Related Functions

Platform Support

Go13, Go16, GoFiler Complete, GoFiler Corporate, GoFiler, GoFiler Lite, GoXBRL

Legato IDE, Legato Basic