Changeset 8d17d4e in lab.git for misc/findsimplified.pl


Ignore:
Timestamp:
Jan 26, 2013 2:18:36 AM (12 years ago)
Author:
mitty <mitty@…>
Branches:
master, trunk
Children:
7ee0f52
Parents:
44957a5
Message:
  • fix: convert non Shift_JIS character only
    • skip needless convert (such as U+8C37 -> U+7A40)

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • misc/findsimplified.pl

    r44957a5 r8d17d4e  
    2020     
    2121    $str = $utf8->decode($str); 
    22     my $jtext = $ck->conv_c2j($str); 
    23     if ($str ne $jtext) { 
    24         return $utf8->encode($jtext); 
     22    my $sjis = encode("cp932", $str, Encode::FB_HTMLCREF); 
     23    if ($sjis =~ /&#\d{4,};/) { 
     24        my $jtext = $ck->conv_c2j($str); 
     25        if ($str ne $jtext) { 
     26            return $utf8->encode($jtext); 
     27        } 
    2528    } 
    2629     
Note: See TracChangeset for help on using the changeset viewer.