Skip to content

Commit

Permalink
parse.y: set encoding
Browse files Browse the repository at this point in the history
* parse.y (rb_str_dynamic_intern): associate proper encoding with
  the result symbol.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
nobu committed Mar 26, 2014
1 parent e8de850 commit bb1d0d2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 0 additions & 3 deletions encoding.c
Original file line number Diff line number Diff line change
Expand Up @@ -747,9 +747,6 @@ rb_enc_get_index(VALUE obj)
obj = rb_id2str(SYM2ID(obj));
}
switch (BUILTIN_TYPE(obj)) {
case T_SYMBOL:
obj = RSYMBOL(obj)->fstr;
/* fall through */
as_default:
default:
case T_STRING:
Expand Down
2 changes: 2 additions & 0 deletions parse.y
Original file line number Diff line number Diff line change
Expand Up @@ -10685,12 +10685,14 @@ rb_str_dynamic_intern(VALUE str)
str = rb_str_dup(str);
rb_enc_associate(str, ascii);
OBJ_FREEZE(str);
enc = ascii;
}
}

type = rb_str_symname_type(str, IDSET_ATTRSET_FOR_INTERN);
str = rb_fstring(str);
dsym = rb_newobj_of(rb_cSymbol, T_SYMBOL);
rb_enc_associate(dsym, enc);
OBJ_FREEZE(dsym);
RSYMBOL(dsym)->fstr = str;
RSYMBOL(dsym)->type = type;
Expand Down

0 comments on commit bb1d0d2

Please sign in to comment.