Permalink
Browse files

fixed perl scripts for newer versions of perl. thanks Rentong Yu for …

…the report.
  • Loading branch information...
1 parent 982ffaf commit d7639fced72d6fef25e9a1024bc21eb1ac000505 @agentzh agentzh committed Jul 21, 2016
Showing with 5 additions and 5 deletions.
  1. +4 −3 utils/tut2wiki-cn.pl
  2. +1 −2 utils/wiki2html-cn.pl
View
7 utils/tut2wiki-cn.pl
@@ -1,8 +1,8 @@
#!/usr/bin/env perl
+use utf8;
use strict;
use warnings;
-use encoding 'utf8';
use Getopt::Std;
my %opts;
@@ -74,7 +74,9 @@
close $in;
-open $in, "<:encoding(UTF-8)", \$src;
+utf8::encode($src);
+
+open $in, "<:encoding(UTF-8)", \$src or die $!;
my $wiki = '';
undef $prev;
@@ -225,4 +227,3 @@
sub usage {
die "Usage: $0 [-o <outfile>] <infile>\n";
}
-
View
3 utils/wiki2html-cn.pl
@@ -1,6 +1,6 @@
#!/usr/bin/env perl
-use encoding 'utf8';
+use utf8;
use strict;
use warnings;
@@ -232,4 +232,3 @@ sub fmt_code {
sub usage {
die "Usage: $0 [-o <outfile>] <infile>\n";
}
-

0 comments on commit d7639fc

Please sign in to comment.