Text Attribute

UNI_NULIFY

Null terminated output.

Since v1.0
#define UNI_NULIFY
 0x80

Discussion 🔗

Text attribute bit flag that indicates that the output buffer must be null terminated by the implementation.

Some functions, like uni_norm, accept an input buffer and an output buffer. The output buffer is the destination buffer that the implementation writes encoded characters to. When this flag is applied to the output buffer the implementation guarantees a NUL character (U+0000) is appended, even if it means truncating the last non-null character. Conceptually, this behavior is like the BSD function strlcpy which also guarantees the destination buffer is null terminated.

The implementation will never append an extraneous null character if the output buffer is already null terminated.

Using this flag with an input buffer will produce UNI_BAD_OPERATION.