diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-03-26 11:30:54 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-03-26 11:30:54 +0000 |
commit | bb1d0d280781b6bf0b9798f8603208c2ef8b1459 (patch) | |
tree | 7df6d45b25ca9f9cf59adc952fadf51f8508fe71 | |
parent | e8de850e6d5f9c4d9928753862b4a18147be8983 (diff) |
parse.y: set encoding
* 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
-rw-r--r-- | encoding.c | 3 | ||||
-rw-r--r-- | parse.y | 2 |
2 files changed, 2 insertions, 3 deletions
diff --git a/encoding.c b/encoding.c index b1afc87bd2..df3d65cd48 100644 --- a/encoding.c +++ b/encoding.c @@ -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: @@ -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; |