Java Utililty Methods Char Array to UTF

List of utility methods to do Char Array to UTF

Description

The list of methods to do Char Array to UTF are organized into topic(s).

Method

intcharsToUtf(char[] src, int srcIndex, byte[] dst, int dstIndex, int len)
Copy characters in source array to bytes in target array, converting them to Utf8 representation.
int j = dstIndex;
int limit = srcIndex + len;
for (int i = srcIndex; i < limit; i++) {
    char ch = src[i];
    if (1 <= ch && ch <= 0x7F) {
        dst[j++] = (byte) ch;
    } else if (ch <= 0x7FF) {
        dst[j++] = (byte) (0xC0 | (ch >> 6));
...