16.1.4 BIFs and Unicode

LANSA has implemented strong typing for all field types. For Built In Functions, this means you cannot pass an Nchar or Nvarchar field as an argument or return value unless the documentation indicates Unicode field types are accepted. Refer to Built-in Function Rules in Technical Reference Guide for a list of the argument and return value types that can take Unicode field types.

If Unicode field types are not accepted as arguments, they can be coerced to native string format using AsNativeString as mentioned in 16.1.3 Intrinsic Functions. If Unicode field types are not accepted as return values, you must use an acceptable field and then assign the value of this field to the Nchar or Nvarchar field. For example:

Use Builtin(UPPERCASE) With_Args(#MYNCHAR.AsNativeString) To_Get(#STD_TEXTL)


However, if the text you are working with is not in the current code page, you may simply end up with a string of question marks.

Many BIFs can be replaced by an Intrinsic Function with equivalent functionality. Always check for an alternative that will avoid data loss by allowing 16.1.1 Unicode Field Types to be used directly. For example:




The TRANSFORM_FILE and TRANSFORM_LIST BIFs support populating lists from disk files and writing lists to disk files.

These BIFs can support files encoded in UTF-8, and this format is recommended when handling 16.1.1 Unicode Field Types. Refer to the File Format argument for details on how to specify that UTF-8 is used. 

Also see

Refer also to Built-in Functions by Category in the Quick Reference in the Technical Reference Guide.