aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-08-27 13:48:09 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-08-27 13:48:09 +0000
commit4461bd2f1f804b82ab4c77902eecaa28bc99be39 (patch)
treedbb2be9e47a0399f33666e16169e1a2bb36f30c0 /include
parenta1a618ead1bf6559cffb903b1d34e05a442957b0 (diff)
downloadruby-4461bd2f1f804b82ab4c77902eecaa28bc99be39.tar.gz
* encoding.c (rb_enc_codelen): raises invalid sequence exception
if ONIGENC_CODE_TO_MBCLEN() returns zero. [ruby-dev:31661] * encoding.c (rb_enc_mbclen): check invalid sequence. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13287 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'include')
-rw-r--r--include/ruby/encoding.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/include/ruby/encoding.h b/include/ruby/encoding.h
index 0fd2e3ce52..805209d15a 100644
--- a/include/ruby/encoding.h
+++ b/include/ruby/encoding.h
@@ -50,8 +50,10 @@ rb_encoding * rb_enc_find(const char *name);
#define rb_enc_mbmaxlen(enc) (enc)->max_enc_len
/* ptr,encoding -> mbclen */
-#define rb_enc_mbclen(p,enc) ONIGENC_MBC_ENC_LEN(enc, (UChar*)p)
-#define rb_enc_codelen(c,enc) ONIGENC_CODE_TO_MBCLEN(enc,c)
+int rb_enc_mbclen(const char*, rb_encoding*);
+
+/* code,encoding -> codelen */
+int rb_enc_codelen(int, rb_encoding*);
/* code,ptr,encoding -> write buf */
#define rb_enc_mbcput(c,buf,enc) ONIGENC_CODE_TO_MBC(enc,c,(UChar*)buf)