Skip to content

Commit d7639fc

Browse files
committed
fixed perl scripts for newer versions of perl. thanks Rentong Yu for the report.
1 parent 982ffaf commit d7639fc

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

utils/tut2wiki-cn.pl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/usr/bin/env perl
22

3+
use utf8;
34
use strict;
45
use warnings;
5-
use encoding 'utf8';
66

77
use Getopt::Std;
88
my %opts;
@@ -74,7 +74,9 @@
7474

7575
close $in;
7676

77-
open $in, "<:encoding(UTF-8)", \$src;
77+
utf8::encode($src);
78+
79+
open $in, "<:encoding(UTF-8)", \$src or die $!;
7880

7981
my $wiki = '';
8082
undef $prev;
@@ -225,4 +227,3 @@
225227
sub usage {
226228
die "Usage: $0 [-o <outfile>] <infile>\n";
227229
}
228-

utils/wiki2html-cn.pl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env perl
22

3-
use encoding 'utf8';
3+
use utf8;
44
use strict;
55
use warnings;
66

@@ -232,4 +232,3 @@ sub fmt_code {
232232
sub usage {
233233
die "Usage: $0 [-o <outfile>] <infile>\n";
234234
}
235-

0 commit comments

Comments
 (0)