ruby-changes:8500
From: yugui <ko1@a...>
Date: Thu, 30 Oct 2008 01:13:30 +0900 (JST)
Subject: [ruby-changes:8500] Ruby:r20034 (ruby_1_9_1): merged r20012 and r20013 from trunk into ruby_1_9_1.
yugui 2008-10-30 01:13:09 +0900 (Thu, 30 Oct 2008) New Revision: 20034 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=20034 Log: merged r20012 and r20013 from trunk into ruby_1_9_1. * ruby.c (load_file_internal): use ASCII-8BIT to prevent conversion. [ruby-core:19579] * ruby.c (load_file_internal): cache common interned IDs. Modified files: branches/ruby_1_9_1/ChangeLog branches/ruby_1_9_1/ruby.c Index: ruby_1_9_1/ChangeLog =================================================================== --- ruby_1_9_1/ChangeLog (revision 20033) +++ ruby_1_9_1/ChangeLog (revision 20034) @@ -25,6 +25,13 @@ * win32/win32.c (rb_w32_write): write to the end of the file when FAPPEND is specified. +Wed Oct 29 09:30:04 2008 Nobuyoshi Nakada <nobu@r...> + + * ruby.c (load_file_internal): use ASCII-8BIT to prevent conversion. + [ruby-core:19579] + + * ruby.c (load_file_internal): cache common interned IDs. + Wed Oct 29 00:43:39 2008 Tadayoshi Funaba <tadf@d...> * complex.c: uses macro in declarations. Index: ruby_1_9_1/ruby.c =================================================================== --- ruby_1_9_1/ruby.c (revision 20033) +++ ruby_1_9_1/ruby.c (revision 20034) @@ -1223,6 +1223,7 @@ int line_start = 1; NODE *tree = 0; rb_encoding *enc; + ID set_encoding; if (!fname) rb_load_fail(fname); @@ -1245,6 +1246,7 @@ f = rb_io_fdopen(fd, mode, fname); } + CONST_ID(set_encoding, "set_encoding"); if (script) { VALUE c = 1; /* something not nil */ VALUE line; @@ -1253,8 +1255,8 @@ int no_ext_enc = !opt->ext.enc.name; int no_int_enc = !opt->intern.enc.name; - enc = rb_usascii_encoding(); - rb_funcall(f, rb_intern("set_encoding"), 1, rb_enc_from_encoding(enc)); + enc = rb_ascii8bit_encoding(); + rb_funcall(f, set_encoding, 1, rb_enc_from_encoding(enc)); if (opt->xflag) { forbid_setid("-x"); @@ -1354,11 +1356,11 @@ enc = rb_locale_encoding(); } else { - enc = rb_usascii_encoding(); + enc = rb_ascii8bit_encoding(); } - rb_funcall(f, rb_intern("set_encoding"), 1, rb_enc_from_encoding(enc)); + rb_funcall(f, set_encoding, 1, rb_enc_from_encoding(enc)); tree = (NODE *)rb_parser_compile_file(parser, fname, f, line_start); - rb_funcall(f, rb_intern("set_encoding"), 1, rb_parser_encoding(parser)); + rb_funcall(f, set_encoding, 1, rb_parser_encoding(parser)); if (script && rb_parser_end_seen_p(parser)) { rb_define_global_const("DATA", f); } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/