Count utf8 bytes correctly

4 bytes per surrogate pair,
3 bytes for U+0800-U+FFFF (except surrogates)
2 bytes for U+0080-U+07FF