Take into account unicode in splitAtPos()
splitAtPos()
takes an index in bytes, like everything else, but calls splitText()
which takes an index in unicode characters.
5abbc2d2 prevents an error (out-of-bound splitAtPos()
if index is near the end of a non-ascii element), but the highlight will not be exactly at the correct position.