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 @@ -2039,12 +2039,20 @@ strio_truncate(VALUE self, VALUE len)
20392039}
20402040
20412041/*
2042- * call-seq:
2043- * strio.external_encoding => encoding
2042+ * call-seq:
2043+ * external_encoding -> encoding or nil
2044+ *
2045+ * Returns an Encoding object that represents the encoding of the string;
2046+ * see {Encoding}[https://docs.ruby-lang.org/en/master/Encoding.html]:
2047+ *
2048+ * strio = StringIO.new('foo')
2049+ * strio.external_encoding # => #<Encoding:UTF-8>
2050+ *
2051+ * Returns +nil+ if +self+ has no string and is in write mode:
2052+ *
2053+ * strio = StringIO.new(nil, 'w+')
2054+ * strio.external_encoding # => nil
20442055 *
2045- * Returns the Encoding object that represents the encoding of the file.
2046- * If the stream is write mode and no encoding is specified, returns
2047- * +nil+.
20482056 */
20492057
20502058static VALUE
You can’t perform that action at this time.
0 commit comments