// This basically figures out how many bytes a UTF-16 string (which is what js sees)
// will take in UTF-8 by replacing a 2 byte character with 2 *'s, etc, and counting that.
// Note, surrogate (\uD800-\uDFFF) characters are counted as 2 bytes, since there's two of them
// This basically figures out how many bytes a UTF-16 string (which is what js sees)
// will take in UTF-8 by replacing a 2 byte character with 2 *'s, etc, and counting that.
// Note, surrogate (\uD800-\uDFFF) characters are counted as 2 bytes, since there's two of them