Skip to content

Commit

Permalink
- Added binmode(STD*, ':utf8') to the code deparsed as Perl (-Rperl)
Browse files Browse the repository at this point in the history
  • Loading branch information
trizen committed Dec 5, 2015
1 parent 39f8628 commit 4a9ebf1
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions bin/sidef
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,15 @@ else {
my $deparsed = deparse_structure($struct, $args{R});

if (defined($args{R}) and lc($args{R}) eq 'perl') {
my $header = "\nuse lib (" . join(', ', map { qq{"\Q$_\E"} } @INC) . ");\n" . "use Sidef;\n";

my $header =
"\nuse lib ("
. join(', ', map { qq{"\Q$_\E"} } @INC) . ");\n"
. "use Sidef;\n\n"
. "binmode(STDIN, ':utf8');\n"
. "binmode(STDOUT, ':utf8');\n"
. "binmode(STDERR, ':utf8') if \$^P == 0;\n";

$deparsed = $header . $deparsed;
}

Expand Down Expand Up @@ -628,7 +636,7 @@ HEAD

close $fh;
}
}
}
} => $path
);

Expand Down

0 comments on commit 4a9ebf1

Please sign in to comment.