summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-02-11 01:47:26 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-02-11 01:47:26 +0000
commitbd5a15f76d87f1e095177f5c5db7b7518561ddcf (patch)
tree7eec163a593f011b1cfe6511da5ad09c335f6f71
parent65753a5838bf32db668ef29a52dc801c306384ee (diff)
* ruby.c (load_file): the encoding of DATA follows the source
file encoding. [ruby-dev:33693] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15428 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--ruby.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 151e283dbf..49b1947270 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Mon Feb 11 10:43:31 2008 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ruby.c (load_file): the encoding of DATA follows the source
+ file encoding. [ruby-dev:33693]
+
Mon Feb 11 06:50:42 2008 Yusuke Endoh <mame@tsg.ne.jp>
* test/ruby/test_pack.rb: fix tests for 64bit CPU.
diff --git a/ruby.c b/ruby.c
index 1467fdfb23..f33096b9f0 100644
--- a/ruby.c
+++ b/ruby.c
@@ -1192,8 +1192,8 @@ load_file(VALUE parser, const char *fname, int script, struct cmdline_options *o
else {
enc = rb_usascii_encoding();
}
- rb_funcall(f, rb_intern("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));
if (script && rb_parser_end_seen_p(parser)) {
rb_define_global_const("DATA", f);
}