aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--encoding.c1
2 files changed, 4 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 719fa74b1e..3b6feb777d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -12,6 +12,9 @@ Tue Jan 22 12:57:07 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
* encoding.c (rb_enc_compatible): encoding must be ASCII
compatible before checking ENC_CODERANGE_7BIT.
+ * encoding.c (rb_enc_compatible): wrong compatibility condition.
+ [ruby-dev:33273]
+
Tue Jan 22 09:26:47 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* string.c (rb_str_each_char): iterates over a shadow.
diff --git a/encoding.c b/encoding.c
index f429f2c816..10e3b3a44c 100644
--- a/encoding.c
+++ b/encoding.c
@@ -669,6 +669,7 @@ rb_enc_compatible(VALUE str1, VALUE str2)
if (cr1 != cr2) {
/* may need to handle ENC_CODERANGE_BROKEN */
if (cr1 == ENC_CODERANGE_7BIT) return enc2;
+ if (cr2 == ENC_CODERANGE_7BIT) return enc1;
}
if (cr2 == ENC_CODERANGE_7BIT) {
if (idx1 == 0) return enc2;