aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--encoding.c2
2 files changed, 7 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 27c5c60200..1cdd7312d1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Wed Feb 20 19:42:03 2008 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * 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 <naruse@ruby-lang.org>
* 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);