Ignore:
Timestamp:
2014-02-12T18:03:06+13:00 (10 years ago)
Author:
ak19
Message:

A question on the mailing list involved accented characters in custom metadata set names (not metadata set values). This exposed an issue in greenstone that could not cope with utf8 characters in metaset names. The cause was the sub Char { use bytes; ... lines when reading XML. These needed to be commented out in both MetadataXMLPlugin and ReadXMLFile (as GreenstoneXMLPlugin inherits from ReadXMLFile). Doing so showed that extra Encode::decode() operations to decode strings read in from XML into utf8 were no longer needed. As a result MetaXMLPlug and GreenstoneXMLPlug no longer call decode on the metadaname name and value read in from XML, or for the full-text, since GreenstoneXMLPlugin in entirety now no longer does the 'use bytes' part. Tested with text and html collections where metadata set nanes created in custom .mds files, their assigned metadata values and a document's full-text all contained the utf-8 specific character of a-macron.

File:
1 edited

Legend:

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

    r28489 r28836  
    364364    # form ... need to explicitly make it UTF-8
    365365   
    366     my $metadata_name = decode("utf-8",$self->{'metadata_name'});
    367     my $metadata_value = decode("utf-8",$self->{'metadata_value'});
     366    my $metadata_name = $self->{'metadata_name'};
     367    my $metadata_value = $self->{'metadata_value'};
     368    #my $metadata_name = decode("utf-8",$self->{'metadata_name'});
     369    #my $metadata_value = decode("utf-8",$self->{'metadata_value'});
    368370   
    369371    &metadatautil::store_saved_metadata($self,
     
    392394# things down significantly in some cases.
    393395sub Char {
    394     use bytes;  # Necessary to prevent encoding issues with XML::Parser 2.31+
     396#    use bytes;  # Necessary to prevent encoding issues with XML::Parser 2.31+
    395397
    396398#    if ($]<5.008) {
Note: See TracChangeset for help on using the changeset viewer.