# Wide character in print at  /usr/bin/pt-archiver line 6700.

**URL:** <https://forums.percona.com/t/wide-character-in-print-at-usr-bin-pt-archiver-line-6700/6502>\
**Category:** Percona Toolkit\
**Created:** [August 13, 2018, 4:35am UTC](https://forums.percona.com/t/wide-character-in-print-at-usr-bin-pt-archiver-line-6700/6502 "2018-08-13T04:35:12Z")\
**Posts on this page:** 8\
**Page:** 2

<div class="post-metadata">

**Author:** ![le\_den](https://avatars.discourse-cdn.com/v4/letter/l/e68b1a/32.png) [@le\_den](https://forums.percona.com/u/le_den)\
**Post date:** [August 27, 2018, 8:27am UTC](https://forums.percona.com/t/wide-character-in-print-at-usr-bin-pt-archiver-line-6700/6502/21 "2018-08-27T08:27:07Z")

</div>

> [@carlos.salguero;52217](#):
>
> Hello,
> 
> Thanks for you patience and your willing to help.  
> May I ask you to do one more test please?
> 
> Add 2 binmode lines as follows: (lines 6649 & 6650)
> 
> ```auto
> 
> 6646 my $need_hdr = $o->get('header') && !-f $archive_file;
> 6647 $archive_fh = IO::File->new($archive_file, ">>$charset")
> 6648 or die "Cannot open $charset $archive_file: $OS_ERROR\n";
> 6649 binmode STDOUT, ":utf8";
> 6650 binmode $archive_fh, ":utf8";
> 6651 $archive_fh->autoflush(1) unless $o->get('buffer');
> 
> ```
> 
> Regards

Hi Carlos,

That helped, the tool is running now without stopping due to reported error. I’ll report back in case it reoccurs.

Thanks for your help, much appreciate it!

---

<div class="post-metadata">

**Author:** ![carlos.salguero](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/carlos.salguero/32/20_2.png) [@carlos.salguero](https://forums.percona.com/u/carlos.salguero)\
**Post date:** [August 27, 2018, 10:33am UTC](https://forums.percona.com/t/wide-character-in-print-at-usr-bin-pt-archiver-line-6700/6502/22 "2018-08-27T10:33:26Z")

</div>

Hi,

Please let me know if it works and if it doesn’t work. I want to officially add the fix.

Thanks for your help.

---

<div class="post-metadata">

**Author:** ![le\_den](https://avatars.discourse-cdn.com/v4/letter/l/e68b1a/32.png) [@le\_den](https://forums.percona.com/u/le_den)\
**Post date:** [August 27, 2018, 10:39am UTC](https://forums.percona.com/t/wide-character-in-print-at-usr-bin-pt-archiver-line-6700/6502/23 "2018-08-27T10:39:06Z")

</div>

Hi,

That works.

Once I added two lines that you asked to add the tool is running since then without any issue, It’s currently archiving DB that have reported characters.

> [@](#):
>
> I want to officially add the fix.

Great, thanks.

---

<div class="post-metadata">

**Author:** ![carlos.salguero](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/carlos.salguero/32/20_2.png) [@carlos.salguero](https://forums.percona.com/u/carlos.salguero)\
**Post date:** [September 10, 2018, 1:40pm UTC](https://forums.percona.com/t/wide-character-in-print-at-usr-bin-pt-archiver-line-6700/6502/24 "2018-09-10T13:40:38Z")

</div>

Hello,

Just a follow up. I’ve created [url][[PT-1611] pt-archiver fails with UTF-8 chars - Percona JIRA](https://jira.percona.com/browse/PT-1611%5B/url%5D)  
It will be released in next PT (3.0.12)

Regards

---

<div class="post-metadata">

**Author:** ![Tobias\_Brox1](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/tobias_brox1/32/8905_2.png) [@Tobias\_Brox1](https://forums.percona.com/u/Tobias_Brox1)\
**Post date:** [January 4, 2023, 1:03pm UTC](https://forums.percona.com/t/wide-character-in-print-at-usr-bin-pt-archiver-line-6700/6502/25 "2023-01-04T13:03:23Z")

</div>

I got the same now with pt-archiver 3.5.0, after replacing the source database from a percona database to a mariadb database. The default character set was also changed. Perhaps it’s related to the mysql-specific charset utf8mb4.

I managed to work around the problem with this hack:

```auto
--- /tmp/pt-archiver-orig	2023-01-04 14:02:54.597644218 +0100
+++ /tmp/pt-archiver	2023-01-04 14:02:42.031017165 +0100
@@ -6642,7 +6642,7 @@
       return 0;
    }

- my $charset = $got_charset || '';
+ my $charset = 'utf8';
    if ($charset eq 'utf8') {
       $charset = ":$charset";
    }

```

---

<div class="post-metadata">

**Author:** ![Tobias\_Brox1](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/tobias_brox1/32/8905_2.png) [@Tobias\_Brox1](https://forums.percona.com/u/Tobias_Brox1)\
**Post date:** [January 4, 2023, 1:21pm UTC](https://forums.percona.com/t/wide-character-in-print-at-usr-bin-pt-archiver-line-6700/6502/26 "2023-01-04T13:21:14Z")

</div>

A more proper fix would probably be to add a `--charset`-option

---

<div class="post-metadata">

**Author:** ![Anand\_Siva](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/anand_siva/32/9633_2.png) [@Anand\_Siva](https://forums.percona.com/u/Anand_Siva)\
**Post date:** [February 6, 2025, 1:35am UTC](https://forums.percona.com/t/wide-character-in-print-at-usr-bin-pt-archiver-line-6700/6502/27 "2025-02-06T01:35:59Z")

</div>

I solved this issue by adding this option to the command  
`--charset utf8`

---

<div class="post-metadata">

**Author:** ![Yunus](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/yunus/32/6430_2.png) [@Yunus](https://forums.percona.com/u/Yunus)\
**Post date:** [February 6, 2025, 6:06am UTC](https://forums.percona.com/t/wide-character-in-print-at-usr-bin-pt-archiver-line-6700/6502/28 "2025-02-06T06:06:17Z")

</div>

If you use latest version of pt-archiver, it should work. It was fixed in 3.5.2

[https://perconadev.atlassian.net/browse/PT-2123](https://perconadev.atlassian.net/browse/PT-2123)

[Previous page](https://forums.percona.com/t/wide-character-in-print-at-usr-bin-pt-archiver-line-6700/6502.md?page=1)
