GoFiler Legato Script Reference
Legato v 1.5b Application v 5.24b
|
Table of Contents | < < Previous | Next >> |
Chapter Five — General Functions (continued)
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.
Use of the Ctrl+? (0x1F) character allows the caller to find bad characters without the ambiguity of a simple question mark. If desired, the character can be replaced with the ReplaceInString function to turn them into a ‘?’ or some other character.
Related Functions
Platform Support
Go13, Go16, GoFiler Complete, GoFiler Corporate, GoFiler, GoFiler Lite, GoXBRL
Legato IDE, Legato Basic
Page revised 2024-10-21
Table of Contents | < < Previous | Next >> |
© 2012-2024 Novaworks, LLC. All rights reserved worldwide. Unauthorized use, duplication or transmission prohibited by law. Portions of the software are protected by US Patents 10,095,672, 10,706,221 and 11,210,456. GoFiler™ and Legato™ are trademarks of Novaworks, LLC. EDGAR® is a federally registered trademark of the U.S. Securities and Exchange Commission. Novaworks is not affiliated with or approved by the U.S. Securities and Exchange Commission. All other trademarks are property of their respective owners. Use of the features specified in this language are subject to terms, conditions and limitations of the Software License Agreement.