summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authorBurdette Lamar <BurdetteLamar@Yahoo.com>2022-02-25 13:12:59 -0600
committerGitHub <noreply@github.com>2022-02-25 13:12:59 -0600
commit26ffda2fd217651e73eb71e6da8f89eb17866f9d (patch)
tree6f41f5b0ce7c206fb9a249d8f739df48330053d3 /io.c
parent189ac52bba8b1355186431acfa335d40991a7406 (diff)
downloadruby-26ffda2fd217651e73eb71e6da8f89eb17866f9d.tar.gz
[DOC] Enhanced RDoc for some encoding methods (#5598)
In String, treats: #b #scrub #scrub! #unicode_normalize #unicode_normalize! #encode #encode! Also adds a note to IO.new (suggested by @jeremyevans).
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:
*