From: "usa (Usaku NAKAMURA)" Date: 2022-12-12T05:00:09+00:00 Subject: [ruby-dev:52019] [Ruby master Feature#19193] drop DOS TEXT mode support Issue #19193 has been updated by usa (Usaku NAKAMURA). > The most important reason we are keeping "text mode" at reading is backward interoperability for old files. agree. > Are many of text files using LF newlines nowadays on Windows? I don't think so. For example, Excel 2021 outputs CRLF newlines when creating a CSV file. Reading as text mode and writing as binary mode by default seems to be a reasonable chioice. But are the complexity acceptable bv users? ---------------------------------------- Feature #19193: drop DOS TEXT mode support https://bugs.ruby-lang.org/issues/19193#change-100568 * Author: YO4 (Yoshinao Muramatsu) * Status: Assigned * Priority: Normal * Assignee: usa (Usaku NAKAMURA) ---------------------------------------- On Windows platform, ```File.open(path, "r")``` returns an object different from "rt" and "rb". I call that DOS TEXT mode here. DOS TEXT mode does * crlf conversion * 0x1a treated EOF charactor on read and others (see Bug #19192). But DOS TEXT mode is almost unnecessary today and it seems to introduce lot of code complexities. Now there is less need for dos text mode * Microsoft's most apps works without CRLF newline. * Creating a crlf text file today should be explicit. (but that is default mode on windows now) * Interpreting EOF charactor can cause trouble. I think it's time to consider dropping DOS TEXT mode. What challenges are there and what preparation is needed? -- https://bugs.ruby-lang.org/