[Bug #18958] format string must be ASCII compatible

This commit is contained in:
Nobuyoshi Nakada 2022-08-19 23:53:33 +09:00
parent 43e8d9a050
commit 1a2f99275b
Notes: git 2022-08-20 10:07:00 +09:00
2 changed files with 11 additions and 0 deletions

View file

@ -250,6 +250,7 @@ rb_str_format(int argc, const VALUE *argv, VALUE fmt)
--argv;
StringValue(fmt);
enc = rb_enc_get(fmt);
rb_must_asciicompat(fmt);
orig = fmt;
fmt = rb_str_tmp_frozen_acquire(fmt);
p = RSTRING_PTR(fmt);