I noticed that string.encode_wtf16_array is not accepting the string range to encode (like sourceStartIndex and sourceEndIndex).
Is it efficient enough to do a slice first and then call encode_wtf16_array or would it be worthwhile to take additional parameters to encode_wtf16_array?