diff options
Diffstat (limited to 'ext/json')
-rw-r--r-- | ext/json/parser/parser.rl | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/ext/json/parser/parser.rl b/ext/json/parser/parser.rl index e3b3f325e6..61674b7812 100644 --- a/ext/json/parser/parser.rl +++ b/ext/json/parser/parser.rl @@ -673,10 +673,7 @@ static VALUE convert_encoding(VALUE source) } if (encindex == binary_encindex) { - if (OBJ_FROZEN(source)) { - source = rb_str_dup(source); - } - return rb_enc_associate_index(source, utf8_encindex); + return rb_enc_associate_index(rb_str_dup(source), utf8_encindex); } return rb_str_conv_enc(source, rb_enc_from_index(encindex), rb_utf8_encoding()); |