diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-01-13 04:50:48 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-01-13 04:50:48 +0000 |
commit | 1be3a4d588faa3900003b78a50e978630ad791e6 (patch) | |
tree | 3bd2da33d3ce33cb720189501e0ba4df5b3a2964 | |
parent | 5646b9bbbd684ea177687665aab72264a64a2778 (diff) | |
download | ruby-1be3a4d588faa3900003b78a50e978630ad791e6.tar.gz ruby-1be3a4d588faa3900003b78a50e978630ad791e6.tar.xz ruby-1be3a4d588faa3900003b78a50e978630ad791e6.zip |
* ruby.c (load_file): script files should not be affected by locale.
[ruby-dev:33054]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15021 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | ruby.c | 8 |
2 files changed, 11 insertions, 2 deletions
@@ -1,3 +1,8 @@ +Sun Jan 13 13:50:46 2008 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * ruby.c (load_file): script files should not be affected by locale. + [ruby-dev:33054] + Sun Jan 13 12:01:32 2008 Eric Hodel <drbrain@segment7.net> * lib/rdoc/generators*: Reorganize RDoc generators. @@ -1151,8 +1151,12 @@ load_file(VALUE parser, const char *fname, int script, struct cmdline_options *o } require_libraries(); /* Why here? unnatural */ } - if (opt->enc_index >= 0) rb_enc_associate_index(f, opt->enc_index); - else rb_enc_associate(f, rb_locale_encoding()); + if (opt->enc_index >= 0) { + rb_enc_associate_index(f, opt->enc_index); + } + else if (f == rb_stdin) { + rb_enc_associate(f, rb_locale_encoding()); + } tree = (NODE *)rb_parser_compile_file(parser, fname, f, line_start); if (script && rb_parser_end_seen_p(parser)) { rb_define_global_const("DATA", f); |