- Timestamp:
- 2011-05-18T20:42:54+12:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/plugins/PagedImagePlugin.pm
r23561 r24028 134 134 package PagedImagePlugin; 135 135 136 use Encode; 136 137 use ReadXMLFile; 137 138 use ReadTextFile; … … 485 486 $self->{'current_section'} = $doc_obj->get_parent_section($self->{'current_section'}); 486 487 } elsif ($element eq "Metadata") { 487 my $meta_name = $self->{'metadata_name'}; 488 489 # text read in by XML::Parser is in Perl's binary byte value 490 # form ... need to explicitly make it UTF-8 491 my $meta_name = decode("utf-8",$self->{'metadata_name'}); 492 my $metadata_value = decode("utf-8",$self->{'metadata_value'}); 493 488 494 if ($meta_name =~ /\./) { 489 495 $meta_name = "ex.$meta_name"; 490 496 } 491 $doc_obj->add_utf8_metadata ($self->{'current_section'}, $meta_name, $self->{'metadata_value'}); 497 498 $doc_obj->add_utf8_metadata ($self->{'current_section'}, $meta_name, $metadata_value); 492 499 $self->{'metadata_name'} = ""; 493 500 $self->{'metadata_value'} = ""; … … 627 634 my $num = 0; 628 635 while (defined ($line = <ITEMFILE>)) { 636 637 # text read in by XML::Parser is in Perl's binary byte value 638 # form ... need to explicitly make it UTF-8 639 $line = decode("utf-8",$line); 640 629 641 next unless $line =~ /\w/; 630 642 chomp $line; … … 706 718 707 719 my $text=""; 708 &ReadTextFile::read_file($self, $filename_full_path, $encoding, $language, \$text); 720 &ReadTextFile::read_file($self, $filename_full_path, $encoding, $language, \$text); # already decoded as utf8 709 721 if (!length ($text)) { 710 722 # It's a bit unusual but not out of the question to have no text, so just give a warning
Note:
See TracChangeset
for help on using the changeset viewer.