Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.4j

Application v 5.22b

  

 

Chapter FiveGeneral Functions (continued)

AnsiToUTF Function

Overview

The AnsiToUTF function takes an 8-bit string in Unicode and converts it to Unicode Text Format (UTF).

Syntax/Parameters

Syntax

string = AnsiToUTF ( string data );

Parameters

data

A string containing ANSI 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.

Remarks

The function moves through the source data and encodes 8-bit ANSI characters to 8-bit Unicode Text Format. While this many seem counter intuitive, upper ANSI characters (0xC0 and above) must be encoded if they are to be used in an UTF context.

Note that there is no way to explicitly tell an 8-bit string’s encoding. Further, if written to a file, a UTF header may need to be manually inserted, depending on the eventual use of the data. See UnicodeToUTF for an example of adding a UTF header.

Related Functions

Platform Support

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

Legato IDE, Legato Basic