Changeset 6465

Show
Ignore:
Timestamp:
02/10/08 11:53:20 (5 years ago)
Author:
tokuhirom
Message:

lang/perl/Encode-JP-Mobile: added '_' prefix for private methods

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/Encode-JP-Mobile/trunk/lib/Encode/JP/Mobile/KDDIJIS.pm

    r5219 r6465  
    2626        $str =~ s/([^\x00-\x7f].*)$//so and $residue = $1; 
    2727    } 
    28     $residue .= jis_sjis( \$str ); 
     28    $residue .= _jis_sjis( \$str ); 
    2929    $_[1] = $residue if $chk; 
    3030 
     
    3535    my ( $obj, $utf8, $chk ) = @_; 
    3636    my $octet = Encode::encode( $obj->_encoding, $utf8, $chk ); 
    37     return sjis_jis( $octet ); 
     37    return _sjis_jis( $octet ); 
    3838} 
    3939 
     
    4141sub JIS_0208 () { 2 } 
    4242sub KANA () { 3 } 
    43 sub sjis_jis { 
     43sub _sjis_jis { 
    4444    my $octet = shift; 
    4545 
     
    113113} 
    114114 
    115 sub jis_sjis { 
     115sub _jis_sjis { 
    116116    local ${^ENCODING}; 
    117117 
     
    129129        } else { 
    130130            $chunk =~ s((..)){ 
    131                 pack "H*", sprintf"%X", jis2sjis_one(hex(unpack "H*", $1)); 
     131                pack "H*", sprintf"%X", _jis2sjis_one(hex(unpack "H*", $1)); 
    132132            }geox; 
    133133            $chunk; 
     
    141141} 
    142142 
    143 sub jis2sjis_one { my $x = shift; return ( xy($x) << 8 ) + zu($x) } # input is binary 
    144  
    145 sub high { my $x = shift; $x >> 8 } 
    146 sub low  { my $x = shift; $x & 0xff } 
    147  
    148 sub xy { 
     143sub _jis2sjis_one { my $x = shift; return ( _xy($x) << 8 ) + _zu($x) } # input is binary 
     144 
     145sub _high { my $x = shift; $x >> 8 } 
     146sub _low  { my $x = shift; $x & 0xff } 
     147 
     148sub _xy { 
    149149    my $jis = shift; 
    150150 
    151     my $pq = high($jis); 
     151    my $pq = _high($jis); 
    152152    my $t  = ceil( $pq / 2 ) + 0x70; 
    153153    my $ans = ($t <= 0x9F) ? $t : $t+0x40; 
     
    163163} 
    164164 
    165 sub zu { 
     165sub _zu { 
    166166    my $jis = shift; 
    167     my $pq  = high($jis); 
    168     my $rs  = low($jis); 
     167    my $pq  = _high($jis); 
     168    my $rs  = _low($jis); 
    169169 
    170170    if ( $pq % 2 ) {    # odd