summaryrefslogtreecommitdiff
path: root/sprintf.c
diff options
context:
space:
mode:
Diffstat (limited to 'sprintf.c')
-rw-r--r--sprintf.c2
1 files changed, 1 insertions, 1 deletions
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);