summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'io.c')
-rw-r--r--io.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/io.c b/io.c
index efe37ca835..19becbd181 100644
--- a/io.c
+++ b/io.c
@@ -8943,6 +8943,13 @@ rb_io_make_open_file(VALUE obj)
* fd = IO.sysopen(path) # => 3
* IO.new(fd) # => #<IO:fd 3>
*
+ * The new \IO object does not inherit encoding
+ * (because the integer file descriptor does not have an encoding):
+ *
+ * fd = IO.sysopen('t.rus', 'rb')
+ * io = IO.new(fd)
+ * io.external_encoding # => #<Encoding:UTF-8> # Not ASCII-8BIT.
+ *
* Optional argument +mode+ (defaults to 'r') must specify a valid mode
* see IO@Modes:
*