But the type signature of that token should make it clear those are <i>byte</i> offsets and not <i>character</i> offsets.  You can use them for byte-wise operations like memcpy, or to explicitly decode them into a string using the original encoding of the string.  You cannot use them for string-wise operations like substring without explicitly casting or converting them to a string.<p>It seems like this whole mess comes from conflating bytes and characters.  They are not the same, any more than integers and booleans are the same just because you can jnz in most assembly languages.