Ignore:
Timestamp:
2014-01-15T14:11:21+13:00 (10 years ago)
Author:
ak19
Message:

Routine for reading in text files failed to 'decode' from UTF-8 to trigger Unicode aware strings. Methods changed to user Superclass to ensure this is now done consitently

File:
1 edited

Legend:

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

    r28669 r28782  
    9696    my $self = shift (@_);
    9797    my ($filename, $encoding, $language, $textref) = @_;
    98     my $outhandle = $self->{'outhandle'};
    9998
    100     # Read the Tab-separated file content
    101     open(FILE, $filename);
    102     my $reader = new multiread();
    103     $reader->set_handle('TabSeparatedPlugin::FILE');
    104     $reader->set_encoding($encoding);
    105     $reader->read_file($textref);
    106     close(FILE);
     99    # Read in file the usual ReadTextFile way
     100    # This ensure that $textref is a unicode aware string
     101    $self->SUPER::read_file(@_);
     102
     103    #
     104    # Now top-up the processing of the text with what this plugin
     105    # needs
     106    #
    107107
    108108    # Remove any blank lines so the data is split and processed properly
Note: See TracChangeset for help on using the changeset viewer.