diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-01-25 08:12:15 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-01-25 08:12:15 +0000 |
| commit | 78a4abd28371610b8b8ec75a19178863c38f5cf3 (patch) | |
| tree | 3ab9e044f475924556bbdc9dcadd5fed85310f5a | |
| parent | 2c2e6ee432bcbdb2e28005021ea2eb42c871c440 (diff) | |
| download | ruby-78a4abd28371610b8b8ec75a19178863c38f5cf3.tar.gz ruby-78a4abd28371610b8b8ec75a19178863c38f5cf3.tar.xz ruby-78a4abd28371610b8b8ec75a19178863c38f5cf3.zip | |
* ruby.c (load_file): set default to ASCII-8BIT explicitly if -K
option is not given.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15233 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 5 | ||||
| -rw-r--r-- | ruby.c | 6 |
2 files changed, 7 insertions, 4 deletions
@@ -1,3 +1,8 @@ +Fri Jan 25 17:12:13 2008 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * ruby.c (load_file): set default to ASCII-8BIT explicitly if -K + option is not given. + Fri Jan 25 16:31:47 2008 Tanaka Akira <akr@fsij.org> * include/ruby/intern.h (rb_str_buf_cat_ascii): declared. @@ -1207,11 +1207,9 @@ load_file(VALUE parser, const char *fname, int script, struct cmdline_options *o } } else { - enc = 0; - } - if (enc) { - rb_funcall(f, rb_intern("set_encoding"), 1, rb_enc_from_encoding(enc)); + enc = rb_ascii8bit_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); if (script && rb_parser_end_seen_p(parser)) { rb_define_global_const("DATA", f); |
