mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
Using is_broken_string function
This commit is contained in:
parent
518301883e
commit
79f50b9d02
Notes:
git
2022-09-10 09:33:12 +09:00
3 changed files with 4 additions and 4 deletions
|
@ -2590,7 +2590,7 @@ rb_econv_prepare_options(VALUE opthash, VALUE *opts, int ecflags)
|
|||
v = rb_hash_aref(opthash, sym_replace);
|
||||
if (!NIL_P(v)) {
|
||||
StringValue(v);
|
||||
if (rb_enc_str_coderange(v) == ENC_CODERANGE_BROKEN) {
|
||||
if (is_broken_string(v)) {
|
||||
VALUE dumped = rb_str_dump(v);
|
||||
rb_raise(rb_eArgError, "replacement string is broken: %s as %s",
|
||||
StringValueCStr(dumped),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue