method

external_encoding

ruby latest stable - Class: StringIO
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.