diff options
Diffstat (limited to 'encoding.c')
-rw-r--r-- | encoding.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/encoding.c b/encoding.c index fe720767c2..eb777c90f3 100644 --- a/encoding.c +++ b/encoding.c @@ -1134,7 +1134,7 @@ enc_inspect(VALUE self) static VALUE enc_name(VALUE self) { - return rb_usascii_str_new2(rb_enc_name((rb_encoding*)DATA_PTR(self))); + return rb_fstring_cstr(rb_enc_name((rb_encoding*)DATA_PTR(self))); } static int @@ -1633,8 +1633,7 @@ static int rb_enc_name_list_i(st_data_t name, st_data_t idx, st_data_t arg) { VALUE ary = (VALUE)arg; - VALUE str = rb_usascii_str_new2((char *)name); - OBJ_FREEZE(str); + VALUE str = rb_fstring_cstr((char *)name); rb_ary_push(ary, str); return ST_CONTINUE; } @@ -1676,8 +1675,7 @@ rb_enc_aliases_enc_i(st_data_t name, st_data_t orig, st_data_t arg) if (STRCASECMP((char*)name, rb_enc_name(enc)) == 0) { return ST_CONTINUE; } - str = rb_usascii_str_new2(rb_enc_name(enc)); - OBJ_FREEZE(str); + str = rb_fstring_cstr(rb_enc_name(enc)); rb_ary_store(ary, idx, str); } key = rb_usascii_str_new2((char *)name); |