X-Git-Url: http://git.equinoxoli.org/?p=migration-tools.git;a=blobdiff_plain;f=dump_oracle_table_for_pg;h=2b18484dc622784360e2ecd88f83b303474c9d00;hp=b226bc26a815caccac2c14786e5f7278970ff612;hb=5fa7a0c2e21eab3d37a5231ca7159feeae48f034;hpb=8f3eec5b9155b53c3b570fe6184ab7d82075ecfb diff --git a/dump_oracle_table_for_pg b/dump_oracle_table_for_pg index b226bc2..2b18484 100755 --- a/dump_oracle_table_for_pg +++ b/dump_oracle_table_for_pg @@ -25,6 +25,7 @@ use Carp; use DBI; use Getopt::Long; use Encode; +use MARC::Charset qw/marc8_to_utf8/; my $host = 'localhost'; my $sid = $ENV{ORACLE_SID}; @@ -81,6 +82,7 @@ export_table(uc $table, $outfh, $sqlfh, $out); close $outfh; close $sqlfh; +$dbh->disconnect; exit 0; @@ -124,7 +126,11 @@ sub normalize_value_for_tsv { $val =~ s/\t/\\t/g; $val =~ s/\v/\\v/g; if ($src_charset) { - return decode($src_charset, $val); + if ($src_charset eq 'marc8') { + return marc8_to_utf8($val); + } else { + return decode($src_charset, $val); + } } else { return $val; }