Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.4j

Application v 5.22b

  

 

Chapter FiveGeneral Functions (continued)

UTFToAnsi Function

Overview

The UTFToAnsi function takes a UTF encoded string and converts it into a 8-bit wide string. Such a conversion may result in loss of data.

Syntax/Parameters

Syntax

string = UTFToAnsi ( string data );

Parameters

data

A string containing UTF text to convert.

Return Value

Returns a string containing the converted string. Use the IsError, IsNotError and GetLastError functions to determine if an error occurred and to retrieve a formatted error code.

If characters cannot be converted, a error condition will be set with an error code in the lo word of the formatted error code.

Remarks

Characters are copied from 8- to 8-bits and those that are UTF are decoded. If sequence is not in valid UTF syntax, each original character is copied. Since the result is 8-bits wide, any characters too large to fit are replaced with Ctrl+? or 0x1F and counted as errors.

Aside from truncating characters over 0xFF, character positions are not translated.

Related Functions

Platform Support

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

Legato IDE, Legato Basic