Changeset 28783

Show
Ignore:
Timestamp:
15.01.2014 14:12:32 (6 years ago)
Author:
ak19
Message:

Treatment of ' and ?' in the MARC*Plugin.pm an issue for Greenstone 3. This commit is a partial fix. See 'Important' comment in MARCPlugin.pm for more details

Location:
main/trunk/greenstone2/perllib/plugins
Files:
2 modified

Legend:

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

    r27141 r28783  
    366366        if (defined $meta_value) { 
    367367        # Square brackets in metadata values need to be escaped so they don't confuse Greenstone/GLI 
     368 
     369        # Important!  Check that this really works!! In MARCXMLPlugin 
     370        # it maps these characters to \\\\[ \\\\] 
     371 
    368372        $meta_value =~ s/\[/&\#091;/g; 
    369373        $meta_value =~ s/\]/&\#093;/g; 
  • main/trunk/greenstone2/perllib/plugins/MARCXMLPlugin.pm

    r27503 r28783  
    415415        } 
    416416         
    417         ## escape [ and ] 
    418         $meta_value =~ s/\[/\\\[/g; 
    419         $meta_value =~ s/\]/\\\]/g; 
    420         ##print STDERR  "$meta_name=$meta_value\n"; 
     417        my $gs_mode = ($ENV{'GSDL3SRCHOME'}) ? "gs3" : "gs2"; 
     418 
     419        if ($gs_mode eq "gs2") { 
     420            ## escape [ and ] 
     421            $meta_value =~ s/\[/\\\[/g; 
     422            $meta_value =~ s/\]/\\\]/g; 
     423 
     424            # The following is how MARCPlug does this 
     425            # If this is really OK for Greenstone2, then consider 
     426            # to switching to this, as this would mean we 
     427            # wouldn't need a special gs2/gs3 test here! 
     428 
     429#           $meta_value =~ s/\[/&\#091;/g; 
     430#           $meta_value =~ s/\]/&\#093;/g; 
     431 
     432            ##print STDERR  "$meta_name=$meta_value\n"; 
     433        } 
     434 
    421435        $doc_obj->add_utf8_metadata($doc_obj->get_top_section(),$meta_name, $meta_value); 
    422436