From: mitty Date: Thu, 24 Jan 2013 13:32:47 +0000 (+0000) Subject: * replace Unicode::Japanese with Encode X-Git-Url: http://lab.mitty.jp/git/?a=commitdiff_plain;h=6f4fe5ee0a6f3874705227f25dcda010177e113b;p=lab.git * replace Unicode::Japanese with Encode git-svn-id: https://lab.mitty.jp/svn/lab/trunk@190 7d2118f6-f56c-43e7-95a2-4bb3031d96e7 --- diff --git a/misc/findnonsjis.pl b/misc/findnonsjis.pl index 7e25e48..dbf8c9c 100755 --- a/misc/findnonsjis.pl +++ b/misc/findnonsjis.pl @@ -5,17 +5,19 @@ use warnings; use utf8; use encoding 'utf-8'; -use Unicode::Japanese qw(unijp); +use Encode; my $top = shift @ARGV || exit; if (! -d $top) { exit; } +my $utf8 = find_encoding("utf8"); + checkdir($top); sub match { my $str = shift @_; - my $sjis = unijp($str)->sjis; + my $sjis = encode("cp932", $utf8->decode($str), Encode::FB_HTMLCREF); if ($sjis =~ /&#\d{4,};/) { return 1; }