Skip to content
instance method

ARGF#external_encoding

ARGF.external_encoding → encoding

Returns the external encoding for files read from ARGF as an Encoding object. The external encoding is the encoding of the text as stored in a file. Contrast with ARGF.internal_encoding, which is the encoding used to represent this text within Ruby.

To set the external encoding use ARGF.set_encoding.

For example:

Example
ARGF.external_encoding  #=>  #<Encoding:UTF-8>
See also #eof? #file #eof #filename also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0