external_encoding()
public
Returns the Encoding object that represents
the encoding of the file. If strio is write mode and no encoding is specified,
returns nil.
static VALUE
strio_external_encoding(VALUE self)
{
struct StringIO *ptr = StringIO(self);
return rb_enc_from_encoding(get_enc(ptr));
}