pub fn count_surrogates(text: &str) -> usize
Counts the utf16 surrogate pairs that would be in a string slice if it were encoded as utf16.
Runs in O(N) time.