class method
Encoding.default_internal=
(::Encoding enc) -> ::Encoding
[T < ::_ToStr] (T enc) -> T
(nil) -> nil
Encoding.default_internal = enc or nil
encoding.c
View on GitHub ↗
static VALUE
set_default_internal(VALUE klass, VALUE encoding)
{
rb_warning("setting Encoding.default_internal");
rb_enc_set_default_internal(encoding);
return encoding;
}
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.