1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* ruby.c (load_file_internal): should not set script encoding to

ASCII-8BIT.

* ruby.c (load_file_internal): do not auto convert scripts even
  when default_internal is set.  [ruby-core:19579]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20056 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2008-10-30 09:17:49 +00:00
parent 9767736b40
commit 86c50e3983
2 changed files with 10 additions and 5 deletions

View file

@ -25,6 +25,14 @@ Thu Oct 30 09:31:45 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* encoding.c (rb_enc_set_default_internal): ditto for internal.
Thu Oct 30 03:30:25 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
* ruby.c (load_file_internal): should not set script encoding to
ASCII-8BIT.
* ruby.c (load_file_internal): do not auto convert scripts even
when default_internal is set. [ruby-core:19579]
Thu Oct 30 02:20:33 2008 Yusuke Endoh <mame@tsg.ne.jp>
* array.c (rb_ary_sort_bang): remove SEGV when replacing array with
@ -123,9 +131,6 @@ Wed Oct 29 11:00:25 2008 NAKAMURA Usaku <usa@ruby-lang.org>
Wed Oct 29 09:30:04 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* 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@dotrb.org>

4
ruby.c
View file

@ -1381,9 +1381,9 @@ load_file_internal(VALUE arg)
enc = rb_locale_encoding();
}
else {
enc = rb_ascii8bit_encoding();
enc = rb_usascii_encoding();
}
rb_funcall(f, set_encoding, 1, rb_enc_from_encoding(enc));
rb_funcall(f, set_encoding, 2, rb_enc_from_encoding(enc), rb_str_new_cstr("-"));
tree = (NODE *)rb_parser_compile_file(parser, fname, f, line_start);
rb_funcall(f, set_encoding, 1, rb_parser_encoding(parser));
if (script && rb_parser_end_seen_p(parser)) {