Changeset 29762

Show
Ignore:
Timestamp:
26.02.2015 12:29:06 (5 years ago)
Author:
ak19
Message:

check if the filenames are url encoded - this happens for eg accented chars on macs, if so, convert back to unicode

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/plugins/MetadataXMLPlugin.pm

    r28836 r29762  
    331331        # FileNames must be regex, but we allow \\ for path separator on windows. convert to / 
    332332        $target = &util::filepath_regex_to_url_format($target); 
     333        if (&unicode::is_url_encoded($target)) { 
     334        print STDERR "***target $target is url encoded "; 
     335        $target = &unicode::url_decode($target); 
     336        print STDERR "   new: $target\n"; 
     337        } 
     338        else { 
     339        print STDERR " *** target $target is NOT url encoded\n"; 
     340        } 
    333341        my $file_metadata = &extrametautil::getmetadata($self->{'metadataref'}, $target); 
    334342        my $saved_metadata = $self->{'saved_metadata'};