LimitUTF8Bytes (open)

Limit a UTF-8 encoded string to a maximum byte length

Syntax

// Core function, no LOADLIB necessary

STRING FUNCTION LimitUTF8Bytes(STRING text, INTEGER numbytes, STRING addiftruncated)

Parameters

STRING text

Text to limit

INTEGER numbytes

Maximum length in bytes

STRING addiftruncated

Text to add if any data is truncated. Will never cause the string to exceed numbytes.

Return value

STRING

Text with a maximum length of numbytes bytes.