End of Life Ruby 3.2 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
Encoding#replicate
enc.replicate(name) → encoding
encoding.c
View on GitHub ↗
static VALUE
enc_replicate_m(VALUE encoding, VALUE name)
{
int idx;
rb_warn_deprecated_to_remove("3.3", "Encoding#replicate", "the original encoding");
idx = rb_enc_replicate(name_for_encoding(&name), rb_to_encoding(encoding));
RB_GC_GUARD(name);
return rb_enc_from_encoding_index(idx);
}
Returns a replicated encoding of enc whose name is name. The new encoding should have the same byte structure of enc. If name is used by another encoding, raise ArgumentError.
Ruby version changes
-
3.2
-
Encoding#replicatehas been deprecated and will be removed in 3.3. [Feature #18949]
-