Skip to content
class method

Encoding.default_internal=

(::Encoding enc) -> ::Encoding
[T < ::_ToStr] (T enc) -> T
(nil) -> nil
Encoding.default_internal = enc or nil

Sets default internal encoding or removes default internal encoding when passed nil. You should not set Encoding::default_internal in ruby code as strings created before changing the value may have a different encoding from strings created after the change. Instead you should use ruby -E to invoke ruby with the correct default_internal.

See Encoding::default_internal for information on how the default internal encoding is used.

See also .default_internal .find .default_external= .list also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0