Changeset 23102

Show
Ignore:
Timestamp:
12.10.2010 11:05:10 (9 years ago)
Author:
davidb
Message:

Attached :utf8 encoding to GDBM pipes to prevent double encoding problem with incremental buildcol.pl

Files:
1 modified

Legend:

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

    r22076 r23102  
    5656  if(!open($infodb_file_handle, "| $cmd")) 
    5757  { 
     58 
    5859      print STDERR "Error: Failed to open pipe to $cmd\n"; 
    5960      print STDERR "       $!\n"; 
    6061      return undef; 
    6162  } 
     63 
     64  binmode($infodb_file_handle,":utf8"); 
    6265 
    6366  return $infodb_file_handle; 
     
    9093  my $infodb_map = shift(@_); 
    9194 
    92   open (PIPEIN, "db2txt \"$infodb_file_path\" |") || die "couldn't open pipe from db2txt \$infodb_file_path\"\n"; 
     95  open (PIPEIN, "db2txt \"$infodb_file_path\" |")  
     96      || die "couldn't open pipe from db2txt \$infodb_file_path\"\n"; 
     97 
     98  binmode(PIPEIN,":utf8"); 
     99 
    93100  my $infodb_line = ""; 
    94101  my $infodb_key = ""; 
     
    120127  my $infodb_map = shift(@_); 
    121128 
    122   open (PIPEIN, "gdbmkeys \"$infodb_file_path\" |") || die "couldn't open pipe from gdbmkeys \$infodb_file_path\"\n"; 
     129  open (PIPEIN, "gdbmkeys \"$infodb_file_path\" |")  
     130      || die "couldn't open pipe from gdbmkeys \$infodb_file_path\"\n"; 
     131 
     132  binmode(PIPEIN,":utf8"); 
     133 
    123134  my $infodb_line = ""; 
    124135  my $infodb_key = "";