method

external_encoding

v2_6_3 - Show latest stable - Class: IO
external_encoding()
public

Returns the Encoding object that represents the encoding of the file. If io is in write mode and no encoding is specified, returns nil.