Changeset 189 in lab


Ignore:
Timestamp:
Jan 24, 2013 9:17:01 PM (11 years ago)
Author:
mitty
Message:
  • find file or directory that name contains non sjis character
File:
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/misc/findnonsjis.pl

    r188 r189  
    66use encoding 'utf-8'; 
    77 
    8 use Unicode::Normalize qw(NFC NFKC); 
     8use Unicode::Japanese qw(unijp); 
    99 
    1010my $top = shift @ARGV || exit; 
     
    1616    my $str = shift @_; 
    1717     
    18     if ($str ne NFC($str)) { 
    19         return 1; 
    20     } 
    21     if ($str ne NFKC($str)) { 
     18    my $sjis = unijp($str)->sjis; 
     19    if ($sjis =~ /&#\d{4,};/) { 
    2220        return 1; 
    2321    } 
     
    3836        next if ($entry =~ /^\.+$/); 
    3937        if (match($entry)) { 
    40             print "'$target/$entry' can be composed\n"; 
     38            print "'$target/$entry' contains non Shift_JIS character\n"; 
    4139            next; 
    4240        } 
Note: See TracChangeset for help on using the changeset viewer.