[前][次][番号順一覧][スレッド一覧]

ruby-changes:59918

From: Lars <ko1@a...>
Date: Tue, 4 Feb 2020 02:14:51 +0900 (JST)
Subject: [ruby-changes:59918] a4fca28b80 (master): Fix description of Encoding.default_(in|ex)ternal

https://git.ruby-lang.org/ruby.git/commit/?id=a4fca28b80

From a4fca28b805cc8714cad1107424d97b822bf6414 Mon Sep 17 00:00:00 2001
From: Lars Kanis <kanis@c...>
Date: Wed, 29 Jan 2020 15:23:03 +0100
Subject: Fix description of Encoding.default_(in|ex)ternal

Data written to files is not transcoded per default, but only
when default_internal is set.

The default for default_internal is nil and doesn't depend on the
source file encoding.

diff --git a/encoding.c b/encoding.c
index c50a470..c77d351 100644
--- a/encoding.c
+++ b/encoding.c
@@ -1475,7 +1475,7 @@ rb_enc_default_external(void) https://github.com/ruby/ruby/blob/trunk/encoding.c#L1475
  * encoding may not be valid.  Be sure to check String#valid_encoding?.
  *
  * File data written to disk will be transcoded to the default external
- * encoding when written.
+ * encoding when written, if default_internal is not nil.
  *
  * The default external encoding is initialized by the locale or -E option.
  */
@@ -1560,8 +1560,7 @@ rb_enc_default_internal(void) https://github.com/ruby/ruby/blob/trunk/encoding.c#L1560
  * The script encoding (__ENCODING__), not default_internal, is used as the
  * encoding of created strings.
  *
- * Encoding::default_internal is initialized by the source file's
- * internal_encoding or -E option.
+ * Encoding::default_internal is initialized with -E option or nil otherwise.
  */
 static VALUE
 get_default_internal(VALUE klass)
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]