Changeset 6f4fe5e in lab.git for misc


Ignore:
Timestamp:
Jan 24, 2013 10:32:47 PM (12 years ago)
Author:
mitty <mitty@…>
Branches:
master, trunk
Children:
89fbc5d
Parents:
cdcfe90
Message:
  • replace Unicode::Japanese with Encode

git-svn-id: https://lab.mitty.jp/svn/lab/trunk@190 7d2118f6-f56c-43e7-95a2-4bb3031d96e7

File:
1 edited

Legend:

Unmodified
Added
Removed
  • misc/findnonsjis.pl

    rcdcfe90 r6f4fe5e  
    66use encoding 'utf-8'; 
    77 
    8 use Unicode::Japanese qw(unijp); 
     8use Encode; 
    99 
    1010my $top = shift @ARGV || exit; 
    1111if (! -d $top) { exit; } 
     12 
     13my $utf8 = find_encoding("utf8"); 
    1214 
    1315checkdir($top); 
     
    1618    my $str = shift @_; 
    1719     
    18     my $sjis = unijp($str)->sjis; 
     20    my $sjis = encode("cp932", $utf8->decode($str), Encode::FB_HTMLCREF); 
    1921    if ($sjis =~ /&#\d{4,};/) { 
    2022        return 1; 
Note: See TracChangeset for help on using the changeset viewer.