Changeset 23166


Ignore:
Timestamp:
2010-10-19T12:05:12+13:00 (14 years ago)
Author:
kjdon
Message:

copying code from gdbm.pm: Attached :utf8 encoding to db pipes to prevent double encoding problem with incremental buildcol.pl

Location:
main/trunk/greenstone2/perllib/dbutil
Files:
2 edited

Legend:

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

    r22076 r23166  
    6868      return undef;
    6969  }
    70 
     70 
     71  binmode($infodb_file_handle,":utf8");
    7172  return $infodb_file_handle;
    7273}
     
    106107
    107108  open (PIPEIN, "$jdb2txt_cmd \"$infodb_file_path\" |") || die "couldn't open pipe from db2txt \$infodb_file_path\"\n";
     109  binmode(PIPEIN,":utf8");
    108110  my $infodb_line = "";
    109111  my $infodb_key = "";
     
    143145
    144146  open (PIPEIN, "$jdbkeys_cmd \"$infodb_file_path\" |") || die "couldn't open pipe from jdbmkeys \$infodb_file_path\"\n";
     147  binmode(PIPEIN,":utf8");
    145148  my $infodb_line = "";
    146149  my $infodb_key = "";
  • main/trunk/greenstone2/perllib/dbutil/sqlite.pm

    r22735 r23166  
    5454  }
    5555
     56  binmode($infodb_handle,":utf8");
     57
    5658  print $infodb_handle "CREATE TABLE IF NOT EXISTS data (key TEXT PRIMARY KEY, value TEXT);\n";
    5759  print $infodb_handle "CREATE TABLE IF NOT EXISTS document_metadata (id INTEGER PRIMARY KEY, docOID TEXT, element TEXT, value TEXT);\n";
     
    99101  else {
    100102
     103      binmode($infodb_handle, ":utf8");
    101104      my $line;
    102105      while (defined($line=<$infodb_handle>)) {
Note: See TracChangeset for help on using the changeset viewer.