diff options
author | S-H-GAMELINKS <gamelinks007@gmail.com> | 2022-11-15 13:21:45 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2022-12-02 01:31:27 +0900 |
commit | 1a64d45c67feed7355d6b53746801acb319394a4 (patch) | |
tree | 7de928b38b2fc079d91120f22d89b92ca6a3e110 /io.c | |
parent | 7bc63d6f430422535f4dd460a98f3a90578e524c (diff) |
Introduce encoding check macro
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/6700
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1646,7 +1646,7 @@ make_writeconv(rb_io_t *fptr) ecflags = fptr->encs.ecflags & ~ECONV_NEWLINE_DECORATOR_READ_MASK; ecopts = fptr->encs.ecopts; - if (!fptr->encs.enc || (fptr->encs.enc == rb_ascii8bit_encoding() && !fptr->encs.enc2)) { + if (!fptr->encs.enc || (rb_is_ascii8bit_enc(fptr->encs.enc) && !fptr->encs.enc2)) { /* no encoding conversion */ fptr->writeconv_pre_ecflags = 0; fptr->writeconv_pre_ecopts = Qnil; @@ -6514,7 +6514,7 @@ rb_io_ext_int_to_encs(rb_encoding *ext, rb_encoding *intern, rb_encoding **enc, ext = rb_default_external_encoding(); default_ext = 1; } - if (ext == rb_ascii8bit_encoding()) { + if (rb_is_ascii8bit_enc(ext)) { /* If external is ASCII-8BIT, no transcoding */ intern = NULL; } |