summaryrefslogtreecommitdiff
path: root/ruby.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-03-02 01:13:15 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-03-02 01:13:15 +0000
commit6a9bfa23bf686b29e85d78a1566950a533e4b8a8 (patch)
treeeb218e3658293e98f7b66910763d38450509a1ad /ruby.c
parent601616d6ff9b6ed2420e6b122f8ed48d5406b175 (diff)
* ruby.c (load_file): parse shebang in us-ascii. a patch from
sheepman <sheepman AT sheepman.sakura.ne.jp> in [ruby-dev:33955] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15670 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ruby.c')
-rw-r--r--ruby.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/ruby.c b/ruby.c
index 7fca2969b8..90dbfe2e3f 100644
--- a/ruby.c
+++ b/ruby.c
@@ -1155,6 +1155,9 @@ load_file(VALUE parser, const char *fname, int script, struct cmdline_options *o
int no_src_enc = !opt->src.enc.name;
int no_ext_enc = !opt->ext.enc.name;
+ enc = rb_usascii_encoding();
+ rb_funcall(f, rb_intern("set_encoding"), 1, rb_enc_from_encoding(enc));
+
if (opt->xflag) {
forbid_setid("-x");
opt->xflag = Qfalse;