Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →
instance method
Encoding#to_s
enc.to_s → string
encoding.c
View on GitHub ↗
static VALUE
enc_name(VALUE self)
{
return rb_fstring_cstr(rb_enc_name((rb_encoding*)DATA_PTR(self)));
}
Returns the name of the encoding.
Example
Encoding::UTF_8.name #=> "UTF-8"