Convert a javascript string index into a unicode character offset
The javascript string index (counting surrogate pairs)
The text in which the offset is calculated
The unicode character offset
Convert a javascript string index into a unicode character offset