Skip to content

Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →

instance method

ARGF#internal_encoding

ARGF.internal_encoding → encoding

Returns the internal encoding for strings read from ARGF as an Encoding object.

If ARGF.set_encoding has been called with two encoding names, the second is returned. Otherwise, if Encoding.default_external has been set, that value is returned. Failing that, if a default external encoding was specified on the command-line, that value is used. If the encoding is unknown, nil is returned.

See also #inspect #lineno #inplace_mode= #lineno= also in 4.1 · 4.0 · 3.4 · 3.2 · 3.1 · 3.0