Ignore:
Timestamp:
2012-04-18T10:39:00+12:00 (12 years ago)
Author:
jmt12
Message:

Adding in test when storing output handle to prevent binmode() function being called on output handles that aren't GLOBs (such as the objects returned by GDBMServer and TDBServer)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/basebuildproc.pm

    r24754 r25411  
    195195
    196196    $self->{'output_handle'} = $handle;
     197    # The output handle isn't always an actual handle. In a couple of the
     198    # database drivers (MSSQL and GDBMServer) it's actually a reference
     199    # to an object. Thus we need to test the type before setting binmode.
     200    # [jmt12]
     201    if (ref $handle eq "GLOB")
     202    {
     203      binmode($handle,":utf8");
     204    }
    197205    binmode($handle,":utf8");
    198206}
Note: See TracChangeset for help on using the changeset viewer.