Changeset 22839

Show
Ignore:
Timestamp:
02.09.2010 14:13:42 (9 years ago)
Author:
davidb
Message:

More explicit use of utf8 for input and output file handling. Relies on strings in Perl being Unicode aware (and not merely binary bytes) otherwise binary bytes will then be incorrectly re-incoded as UTF-8 (which is not what you want as they already are in UTF-8 form).

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

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/plugouts/GreenstoneXMLPlugout.pm

    r19494 r22839  
    9292    } 
    9393     
     94    binmode($outhandler,":utf8"); 
     95 
    9496    $self->output_xml_header($outhandler,"Archive"); 
    9597    my $section_output = &docprint::get_section_xml($doc_obj, $doc_obj->get_top_section()); 
  • main/trunk/greenstone2/perllib/plugouts/METSPlugout.pm

    r20643 r22839  
    9595    }  
    9696 
     97    binmode($outhandler,":utf8"); 
     98 
    9799    $self->output_xml_header($outhandler); 
    98100    my $section = $doc_obj->get_top_section(); 
     
    132134       $outhandler = $self->get_output_handler($doc_mets_file); 
    133135     }    
    134   
    135        
     136        
     137    binmode($outhandler,":utf8"); 
     138 
    136139    $self->output_mets_xml_header($outhandler, $doc_obj->get_OID(), $doc_title); 
    137140    $self->output_mets_section($outhandler, $doc_obj, $doc_obj->get_top_section(),$working_dir);