Show
Ignore:
Timestamp:
16.11.2016 17:32:40 (3 years ago)
Author:
ak19
Message:

Text item files now handle UTF-8 properly by reading in the file correctly.

Files:
1 modified

Legend:

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

    r28355 r31113  
    701701    $doc_obj->set_utf8_metadata_element ($topsection, "gsdlthistype", $self->{'documenttype'}); 
    702702    } 
    703     open (ITEMFILE, $filename_full_path) || die "couldn't open $filename_full_path\n"; 
     703    open (ITEMFILE, "<:encoding(UTF-8)", $filename_full_path) || die "couldn't open $filename_full_path\n"; 
    704704    my $line = ""; 
    705705    my $num = 0; 
    706706    while (defined ($line = <ITEMFILE>)) { 
    707      
    708     # Since process_item is called not on an XML item file, but a text item file 
    709     # don't decode into UTF8 the text that was read in, since it's already UTF-8     
    710     #$line = decode("utf-8",$line); 
    711707     
    712708    next unless $line =~ /\w/;