summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authorS-H-GAMELINKS <gamelinks007@gmail.com>2022-05-01 23:13:59 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2022-06-17 12:02:50 +0900
commit420f3ced4d25c0e81d06f3186c8cfdc509326268 (patch)
tree273755e3b753cd5aed06f786947cd7dcc2f223f5 /io.c
parent51a3ebf4ec6182ee516992dc761950d19a7b697b (diff)
downloadruby-420f3ced4d25c0e81d06f3186c8cfdc509326268.tar.gz
Using is_ascii_string to check encoding
Diffstat (limited to 'io.c')
-rw-r--r--io.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/io.c b/io.c
index 170ccc690a..fc1a5d8110 100644
--- a/io.c
+++ b/io.c
@@ -3836,7 +3836,7 @@ check_getline_args(VALUE *rsp, long *limit, VALUE io)
enc_rs = rb_enc_get(rs);
enc_io = io_read_encoding(fptr);
if (enc_io != enc_rs &&
- (rb_enc_str_coderange(rs) != ENC_CODERANGE_7BIT ||
+ (!is_ascii_string(rs) ||
(RSTRING_LEN(rs) > 0 && !rb_enc_asciicompat(enc_io)))) {
if (rs == rb_default_rs) {
rs = rb_enc_str_new(0, 0, enc_io);