Note that the number of code points is
not the same as the `width` of the string when
printed on the screen.If a given string is in UTF-8 and has not been properly normalized
(e.g. by stri_trans_nfc
), the returned counts may sometimes be
misleading. Moreover, if an incorrect UTF-8 byte sequence is detected,
then a warning is generated and the corresponding output element
is set to NA
, see also stri_enc_toutf8
for a method
to deal with such cases.
Missing values are handled properly,
as opposed to the built-in nchar
function.
For `byte` encodings we get, as usual, an error.