Changeset 22953

Show
Ignore:
Timestamp:
23.09.2010 17:23:28 (9 years ago)
Author:
davidb
Message:

Further code tweaks to correctly support Unicode aware strings in our plugin code

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

Legend:

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

    r22705 r22953  
    10151015    my ($textref, $filename) = @_; 
    10161016     
    1017     if (!open (FILE, ">$filename")) { 
     1017    if (!open (FILE, ">:utf8", $filename)) { 
    10181018    gsprintf(STDERR, "ConvertToPlug::write_file {ConvertToPlug.could_not_open_for_writing} ($!)\n", $filename); 
    10191019     die "\n"; 
  • main/trunk/greenstone2/perllib/plugins/PDFPlugin.pm

    r22874 r22953  
    332332    } 
    333333 
     334 
     335    # The following should no longer be needed, now that strings 
     336    # read in are Unicode aware (in the Perl sense) rather than 
     337    # raw binary strings that just happen to be UTF-8 compliant 
     338 
    334339    # turn any high bytes that aren't valid utf-8 into utf-8. 
    335     unicode::ensure_utf8(\$text); 
     340##    unicode::ensure_utf8(\$text); 
    336341 
    337342    # Write it out again!