Calculate the UTF-8 byte length of a string. Handles all Unicode characters including surrogate pairs correctly.
The string to measure
The byte length when encoded as UTF-8
Calculate the UTF-8 byte length of a string. Handles all Unicode characters including surrogate pairs correctly.