int rb_enc_codelen(int c, rb_encoding *enc) { int n = ONIGENC_CODE_TO_MBCLEN(enc,c); if (n == 0) { rb_raise(rb_eArgError, "invalid codepoint 0x%x in %s", c, rb_enc_name(enc)); } return n; }
int rb_enc_code_to_mbclen(int code, rb_encoding *enc) { return ONIGENC_CODE_TO_MBCLEN(enc, code); }