From e5724f41cffbc418645e0bbab6b311d0feedf2a3 Mon Sep 17 00:00:00 2001 From: Carlos Salguero Date: Mon, 10 Sep 2018 14:51:53 -0300 Subject: [PATCH] PT-1611 pt-archiver support writing the output having utf-8 chars --- bin/pt-archiver | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bin/pt-archiver b/bin/pt-archiver index 3e8a1f9d..5c82c07c 100755 --- a/bin/pt-archiver +++ b/bin/pt-archiver @@ -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"