This is often not the function you would normally use
in your string processing activities. See rather stri_length
.For 8-bit encoded strings, this is the same as stri_length
.
For UTF-8 strings, the returned values may be greater
than the number of code points, as UTF-8 is not a fixed-byte encoding:
one code point may be encoded by 1-4 bytes
(according to the current Unicode standard).
Missing values are handled properly,
as opposed to the built-in nchar(str, "bytes")
function call.
The strings do not need to be re-encoded to perform this operation.
The returned values does not of course include the trailing NUL bytes,
which are used internally to mark the end of string data (in C).