Changeset 23169

Show
Ignore:
Timestamp:
19.10.2010 14:53:17 (9 years ago)
Author:
kjdon
Message:

need to set binmode for pipes to get utf8 input and output. also need gzip to decompress to stdout otherwise we can't read in the records

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/dbutil/gdbmtxtgz.pm

    r22485 r23169  
    5757      return undef; 
    5858  } 
    59  
     59  binmode($infodb_file_handle,":utf8"); 
    6060  return $infodb_file_handle; 
    6161} 
     
    8585  my $infodb_map = shift(@_); 
    8686 
    87   my $cmd = "gzip --decompress \"$infodb_file_path\""; 
     87  my $cmd = "gzip --decompress --to-stdout \"$infodb_file_path\""; 
    8888 
    8989  open (PIPEIN, "$cmd |")  
    9090  || die "Error: Couldn't open pipe from gzip: $!\n  $cmd\n"; 
    9191 
     92  binmode(PIPEIN,":utf8"); 
    9293  my $infodb_line = ""; 
    9394  my $infodb_key = ""; 
     
    120121  my $infodb_map = shift(@_); 
    121122 
    122   my $cmd = "gzip --decompress \"$infodb_file_path\""; 
     123  my $cmd = "gzip --decompress --to-stdout \"$infodb_file_path\""; 
    123124 
    124125  open (PIPEIN, "$cmd |")  
    125126  || die "Error: Couldn't open pipe from gzip: $!\n  $cmd\n"; 
    126127 
     128  binmode(PIPEIN,":utf8"); 
    127129  my $infodb_line = ""; 
    128130  my $infodb_key = "";