aboutsummaryrefslogtreecommitdiffstats
path: root/string.c
diff options
context:
space:
mode:
Diffstat (limited to 'string.c')
-rw-r--r--string.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/string.c b/string.c
index 7e7ae7f0a8..e1bd9a052e 100644
--- a/string.c
+++ b/string.c
@@ -6637,7 +6637,7 @@ tr_trans(VALUE str, VALUE src, VALUE repl, int sflag)
}
}
- if (cr == ENC_CODERANGE_VALID)
+ if (cr == ENC_CODERANGE_VALID && rb_enc_asciicompat(e1))
cr = ENC_CODERANGE_7BIT;
str_modify_keep_cr(str);
s = RSTRING_PTR(str); send = RSTRING_END(str);