this.string = string;
int i = 0; int length = 0;  while (i < string.length) { length++; if ((string[i] & 0xf0) == 0xf0) {  length++; i += 4; } else if ((string[i] & 0xe0) == 0xe0) { i += 3; } else if ((string[i] & 0xc0) == 0xc0) { i += 2; } else { i += 1; } }  char[] cs = new char[length];  i = 0; length = 0;  while (i < string.length) { char ch;  if ((string[i] & 0xf0) == 0xf0) { int codePoint = ((string[i] & 0x0F) << 18) | ((string[i+1] & 0x3F) << 12) | ((string[i+2] & 0x3F) << 6) | (string[i+3] & 0x3F); int U = codePoint - 0x10000; char W1 = (char)(0xD800 | (U >> 10)); char W2 = (char)(0xDC00 | (U & 0x3FF)); cs[length++] = W1; ch = W2; i += 4; } else if ((string[i] & 0xe0) == 0xe0) { ch = (char)(((string[i] & 0x1f) << 12) | ((string[i + 1] & 0x3f) << 6) | (string[i + 2] & 0x3f)); i += 3; } else if ((string[i] & 0xc0) == 0xc0) { ch = (char)(((string[i] & 0x3f) << 6) | (string[i + 1] & 0x3f)); i += 2; } else { ch = (char)(string[i] & 0xff); i += 1; }  cs[length++] = ch; }  this.string = new String(cs);
    public DERUTF8String(        String   string)    {        this.string = string;    }