From 14bcf69c9c36875c7956d0ec8c04bfeaec514dd1 Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Sat, 3 Sep 2022 12:46:57 +0200 Subject: Deprecate Encoding#replicate * See [Feature #18949]. --- encoding.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'encoding.c') diff --git a/encoding.c b/encoding.c index b8fedfb797..5c4dfad3f0 100644 --- a/encoding.c +++ b/encoding.c @@ -17,6 +17,7 @@ #include "internal.h" #include "internal/enc.h" #include "internal/encoding.h" +#include "internal/error.h" #include "internal/inits.h" #include "internal/load.h" #include "internal/object.h" @@ -569,7 +570,10 @@ rb_enc_replicate(const char *name, rb_encoding *encoding) static VALUE enc_replicate_m(VALUE encoding, VALUE name) { - int idx = rb_enc_replicate(name_for_encoding(&name), rb_to_encoding(encoding)); + 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); } -- cgit v1.2.1