Changeset 29760

Show
Ignore:
Timestamp:
23.02.2015 14:09:06 (5 years ago)
Author:
kjdon
Message:

try decoding against locale rather than utf8. will this work on wondows/mac?? need to test there. locale is a special thing provided by Encoding::Locale

Files:
1 modified

Legend:

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

    r29745 r29760  
    4242no strict 'subs'; 
    4343 
     44use Encode::Locale; 
    4445use Encode; 
    4546 
     
    333334    # Recursively read each $raw_subfile 
    334335    print $outhandle "DirectoryPlugin block recurring: ". Encode::decode("utf8", $raw_file_subfile) ."\n" if ($verbosity > 2); 
     336    print $outhandle "DirectoryPlugin block recurring: ". Encode::decode(locale =>$raw_file_subfile) ."\n" if ($verbosity > 2); 
    335337     
    336338    #$count += &plugin::file_block_read ($pluginfo, $this_file_base_dir, 
     
    541543    my $this_file_base_dir = $base_dir; 
    542544    my $raw_subfile = &unicode::url_encoded_to_raw_filename($subfile); 
    543     my $unicode_subfile = &Encode::decode("utf8", $raw_subfile); 
    544  
     545    #my $unicode_subfile = &Encode::decode("utf8", $raw_subfile); 
     546    my $unicode_subfile = &Encode::decode(locale => $raw_subfile); 
     547     
    545548    my $raw_file_subfile = &FileUtils::filenameConcatenate($file, $raw_subfile); 
    546549    my $raw_full_filename  
     
    604607        foreach my $filespec (@extrametakeys) { 
    605608        ## use the url-encoded filename to do the filename comparison 
    606         print STDERR "comparing against filespec $filespec\n"; 
    607         print STDERR &unicode::debug_unicode_string("comparing against filespec $filespec\n"); 
     609        print STDERR "comparing against filespec $filespec ("; 
     610        print STDERR &unicode::debug_unicode_string("$filespec"); 
     611        print STDERR ")\n"; 
    608612        if ($unicode_subfile =~ /^$filespec$/) { 
    609613        ###if ($lookup_name =~ /^$filespec$/) {