However, when Encoding.default_external is set to ASCII-8BIT, IO.readlines will always use ASCII-8BIT, regardless of what Encoding.default_internal is set to:
If external encoding is ASCII-8BIT, the input content is considered as binary.
It is out of text encoding conversion and its encoding kept as ASCII-8BIT even if default_internal is set.
This issue was solved with changeset r40610.
Leo, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.
io.c (rb_io_ext_int_to_encs): ignore internal encoding if external
encoding is ASCII-8BIT. [Bug #8342]