Skip to main content

UTF8

UTF8[_locale]

A UTF-8 encoded unicode character string of variable length to the size needed to contain the result of the cast or passed parameter. The optional locale specifies a valid unicode locale code, as specified in ISO standards 639 and 3166 (not needed if LOCALE is specified on the RECORD structure containing the field definition).

Type casting UTF8 to UNICODE, VARUNICODE, STRING, or DATA is allowed, while casting to any other type will first implicitly cast to STRING and then cast to the target value type.

The upper size limit for any UTF8 value is 4GB.

Example:

UTF8 FirstName := U8'Noël';
        // utf-8-encoded string
UTF8_de MyUnicodeString := U8'abcd\353';
        // becomes 'abcdë' with a German locale