try {
cid = font.encodeToCID(string, i, codeLength);
if (cid == -1 && i + 1 < string.length) {
// maybe a multibyte encoding
codeLength++;
cid = font.encodeToCID(string, i, codeLength);
}
} catch (IOException e) {
throwContentStreamException("Encoding can't interpret the character code", ERROR_FONTS_ENCODING_ERROR);
}