Changeset 4934

Show
Ignore:
Timestamp:
10/30/09 02:10:14 (4 weeks ago)
Author:
asawada
Message:

Decode from system filename to utf8 before encoding. bugzid:102920.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/greyhound/lib/MT/Util/Archive/Tgz.pm

    r4925 r4934  
    129129    return $obj->error(MT->translate('Can\'t write to the object')) 
    130130        if 'r' eq $obj->{_mode}; 
    131     $file_path = Encode::encode_utf8($file_path) 
    132         if Encode::is_utf8($file_path); 
     131    my $encoded_path = $file_path; 
     132    $encoded_path = MT::FileMgr::Local::_syserr($encoded_path) 
     133        if !Encode::is_utf8($encoded_path); 
     134    $encoded_path = Encode::encode_utf8($encoded_path) 
     135        if Encode::is_utf8($encoded_path); 
    133136    my $filename = 
    134137        File::Spec->catfile( $path, $file_path ); 
    135138    my $arc = $obj->{_arc}; 
    136139    my @arc_files = $arc->add_files($filename); 
    137     $arc_files[0]->rename( $file_path ); 
     140    $arc_files[0]->rename( $encoded_path ); 
    138141} 
    139142