PT-1611 pt-archiver support writing the output having utf-8 chars

This commit is contained in:
Carlos Salguero
2018-09-10 14:51:53 -03:00
parent 672be1a2b2
commit e5724f41cf

View File

@@ -6646,6 +6646,8 @@ sub main {
my $need_hdr = $o->get('header') && !-f $archive_file;
$archive_fh = IO::File->new($archive_file, ">>$charset")
or die "Cannot open $charset $archive_file: $OS_ERROR\n";
binmode STDOUT, ":utf8";
binmode $archive_fh, ":utf8";
$archive_fh->autoflush(1) unless $o->get('buffer');
if ( $need_hdr ) {
print { $archive_fh } '', escape(\@sel_cols, $fields_separated_by, $optionally_enclosed_by), "\n"