ruby-changes:72836
From: Alan <ko1@a...>
Date: Sat, 6 Aug 2022 03:34:27 +0900 (JST)
Subject: [ruby-changes:72836] ca8daf70fa (master): [DOC] Mention Windows text mode EOF marker interpretation
https://git.ruby-lang.org/ruby.git/commit/?id=ca8daf70fa From ca8daf70fa7045aa1e505514497d1ac4720a6b16 Mon Sep 17 00:00:00 2001 From: Alan Wu <XrXr@u...> Date: Wed, 3 Aug 2022 10:48:43 -0400 Subject: [DOC] Mention Windows text mode EOF marker interpretation I don't think this is super well known so it's worth mentioning as it can be a pitfall. See: https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/fopen-wfopen?view=msvc-170 Co-authored-by: Nobuyoshi Nakada <nobu@r...> --- io.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/io.c b/io.c index c91899a6fe..f2c64989df 100644 --- a/io.c +++ b/io.c @@ -14504,9 +14504,11 @@ set_LAST_READ_LINE(VALUE val, ID _x, VALUE *_y) https://github.com/ruby/ruby/blob/trunk/io.c#L14504 * Either of the following may be suffixed to any of the string read/write modes above: * * - <tt>'t'</tt>: Text data; sets the default external encoding to +Encoding::UTF_8+; - * on Windows, enables conversion between EOL and CRLF. + * on Windows, enables conversion between EOL and CRLF and enables interpreting +0x1A+ + * as an end-of-file marker. * - <tt>'b'</tt>: Binary data; sets the default external encoding to +Encoding::ASCII_8BIT+; - * on Windows, suppresses conversion between EOL and CRLF. + * on Windows, suppresses conversion between EOL and CRLF and disables interpreting +0x1A+ + * as an end-of-file marker. * * If neither is given, the stream defaults to text data. * -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/