Skip to content

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

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

  1. 3.2
See also #names #to_s #name also in 3.1 · 3.0