From bf1a1eab8ab75f495c2d81fae907bed6a071ffae Mon Sep 17 00:00:00 2001 From: mitty Date: Fri, 25 Jan 2013 16:38:41 +0000 Subject: [PATCH] * output string contains numeric character references git-svn-id: https://lab.mitty.jp/svn/lab/trunk@197 7d2118f6-f56c-43e7-95a2-4bb3031d96e7 --- misc/findnonsjis.pl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/misc/findnonsjis.pl b/misc/findnonsjis.pl index 1ae7aef..71e9a0a 100755 --- a/misc/findnonsjis.pl +++ b/misc/findnonsjis.pl @@ -18,7 +18,8 @@ sub match { my $sjis = encode("cp932", $utf8->decode($str), Encode::FB_HTMLCREF); if ($sjis =~ /&#\d{4,};/) { - return 1; + Encode::from_to($sjis, "cp932", "utf8"); + return $sjis; } return ''; @@ -34,8 +35,8 @@ sub checkdir { my @dirs; while (my $entry = shift @entries) { - if (match($entry)) { - print "'$target/$entry' contains non Shift_JIS character\n"; + if (my $convert = match($entry)) { + print "'$target/$entry' can be converted to '$convert'\n"; next; } if (-d "$target/$entry") { -- 1.7.9.5