UTF8toUTF16

fun UTF8toUTF16(utf8: ByteArray, offset: Int, length: Int, out: CharArray): Int

Interprets the given byte array as UTF-8 and converts to UTF-16. It is the responsibility of the caller to make sure that the destination array is large enough.

NOTE: Full characters are read, even if this reads past the length passed (and can result in an ArrayOutOfBoundsException if invalid UTF-8 is passed). Explicit checks for valid UTF-8 are not performed.


fun UTF8toUTF16(bytesRef: BytesRef, chars: CharArray): Int

Utility method for .UTF8toUTF16

See also

.UTF8toUTF16