File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed
Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -2047,12 +2047,20 @@ strio_truncate(VALUE self, VALUE len)
20472047}
20482048
20492049/*
2050- * call-seq:
2051- * strio.external_encoding => encoding
2050+ * call-seq:
2051+ * external_encoding -> encoding or nil
2052+ *
2053+ * Returns an Encoding object that represents the encoding of the string;
2054+ * see {Encoding}[https://docs.ruby-lang.org/en/master/Encoding.html]:
2055+ *
2056+ * strio = StringIO.new('foo')
2057+ * strio.external_encoding # => #<Encoding:UTF-8>
2058+ *
2059+ * Returns +nil+ if +self+ has no string and is in write mode:
2060+ *
2061+ * strio = StringIO.new(nil, 'w+')
2062+ * strio.external_encoding # => nil
20522063 *
2053- * Returns the Encoding object that represents the encoding of the file.
2054- * If the stream is write mode and no encoding is specified, returns
2055- * +nil+.
20562064 */
20572065
20582066static VALUE
You can’t perform that action at this time.
0 commit comments