ruby-changes:33360
From: nobu <ko1@a...>
Date: Wed, 26 Mar 2014 20:31:01 +0900 (JST)
Subject: [ruby-changes:33360] nobu:r45439 (trunk): parse.y: set encoding
nobu 2014-03-26 20:30:54 +0900 (Wed, 26 Mar 2014) New Revision: 45439 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=45439 Log: parse.y: set encoding * parse.y (rb_str_dynamic_intern): associate proper encoding with the result symbol. Modified files: trunk/encoding.c trunk/parse.y Index: encoding.c =================================================================== --- encoding.c (revision 45438) +++ encoding.c (revision 45439) @@ -747,9 +747,6 @@ rb_enc_get_index(VALUE obj) https://github.com/ruby/ruby/blob/trunk/encoding.c#L747 obj = rb_id2str(SYM2ID(obj)); } switch (BUILTIN_TYPE(obj)) { - case T_SYMBOL: - obj = RSYMBOL(obj)->fstr; - /* fall through */ as_default: default: case T_STRING: Index: parse.y =================================================================== --- parse.y (revision 45438) +++ parse.y (revision 45439) @@ -10685,12 +10685,14 @@ rb_str_dynamic_intern(VALUE str) https://github.com/ruby/ruby/blob/trunk/parse.y#L10685 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; -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/