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 '';
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") {