Ignore:
Timestamp:
2010-11-26T12:09:53+13:00 (13 years ago)
Author:
davidb
Message:

More careful use of encoding parameter to $self->set_Source_metadata so it reflects the *filename* encoding that Greenstone has worked out, not the encoding for the *content* of the file, which of course could be completely different!

File:
1 edited

Legend:

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

    r20609 r23349  
    212212
    213213    my $processor = $self->{'processor'};
    214  
     214    my $metadata  = $self->{'metadata'};
     215
    215216    ##create a new document for each record
    216217    if ($element eq "record") {
     
    222223    $doc_obj->add_utf8_metadata($doc_obj->get_top_section(), "Language", $language);
    223224    $doc_obj->add_utf8_metadata($doc_obj->get_top_section(), "Encoding", $encoding);
     225
    224226    my ($filemeta) = $file =~ /([^\\\/]+)$/;
    225     $self->set_Source_metadata($doc_obj, $filemeta, $encoding);
     227    my $plugin_filename_encoding = $self->{'filename_encoding'};
     228    my $filename_encoding = $self->deduce_filename_encoding($file,$metadata,$plugin_filename_encoding);
     229    $self->set_Source_metadata($doc_obj, $filemeta, $filename_encoding);
     230
    226231    $doc_obj->add_utf8_metadata($doc_obj->get_top_section(), "SourceSegment", "$self->{'record_count'}");
    227232        if ($self->{'cover_image'}) {
Note: See TracChangeset for help on using the changeset viewer.