aboutsummaryrefslogtreecommitdiffstats
path: root/encoding.c
diff options
context:
space:
mode:
Diffstat (limited to 'encoding.c')
-rw-r--r--encoding.c1
1 files changed, 1 insertions, 0 deletions
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;