utf8Size

Returns the number of bytes this string occupies when encoded as UTF-8, computed from its code points without allocating an encoded copy.

Surrogate pairs count as 4 bytes. An unpaired surrogate counts as 3 bytes, the encoded size of the replacement character that standard encoders substitute for it. Returns 0 for an empty string.