Changeset 31113 for main


Ignore:
Timestamp:
2016-11-16T17:32:40+13:00 (7 years ago)
Author:
ak19
Message:

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

File:
1 edited

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/;
Note: See TracChangeset for help on using the changeset viewer.