From bdf3032e3542b318c6f52dbe20d1c97cca3d7067 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Wed, 12 Feb 2020 19:29:18 +0900 Subject: Make temporary lock string encoding free As a temporary lock string is hidden, it can not have instance variables, including non-inlined encoding index. --- sprintf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sprintf.c') diff --git a/sprintf.c b/sprintf.c index 64cfdee1a1..ff1800e088 100644 --- a/sprintf.c +++ b/sprintf.c @@ -257,7 +257,7 @@ rb_str_format(int argc, const VALUE *argv, VALUE fmt) blen = 0; bsiz = 120; result = rb_str_buf_new(bsiz); - rb_enc_copy(result, fmt); + rb_enc_associate(result, enc); buf = RSTRING_PTR(result); memset(buf, 0, bsiz); ENC_CODERANGE_SET(result, coderange); -- cgit v1.2.3