diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | encoding.c | 2 |
2 files changed, 7 insertions, 0 deletions
@@ -1,3 +1,8 @@ +Wed Feb 20 19:42:03 2008 NARUSE, Yui <[email protected]> + + * encoding.c (rb_enc_associate_index): doesn't clear coderange + when new encoding equals to old one. + Wed Feb 20 19:15:38 2008 NARUSE, Yui <[email protected]> * string.c (rb_enc_str_copy): added for wrapper for rb_enc_copy. diff --git a/encoding.c b/encoding.c index 15a0687281..b64688e0f5 100644 --- a/encoding.c +++ b/encoding.c @@ -613,6 +613,8 @@ void rb_enc_associate_index(VALUE obj, int idx) { enc_check_capable(obj); + if (rb_enc_get_index(obj) == idx) + return; if (!ENC_CODERANGE_ASCIIONLY(obj) || !rb_enc_asciicompat(rb_enc_from_index(idx))) { ENC_CODERANGE_CLEAR(obj); |