End of Life Ruby 3.2 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
Encoding.default_external
static VALUE
get_default_external(VALUE klass)
{
return rb_enc_default_external();
}
Returns default external encoding.
The default external encoding is used by default for strings created from the following locations:
-
Filedata read from disk -
SDBM
While strings created from these locations will have this encoding, the encoding may not be valid. Be sure to check String#valid_encoding?.
File data written to disk will be transcoded to the default external encoding when written, if default_internal is not nil.
The default external encoding is initialized by the -E option. If -E isn’t set, it is initialized to UTF-8 on Windows and the locale on other operating systems.
Ruby version changes
-
3.0
-
Changed default for
Encoding.default_externalto UTF-8 on Windows [Feature #16604]
-