From 125cd234d402e774a99f76bb10da7e54a3f4d88e Mon Sep 17 00:00:00 2001 From: Kai Moschcau Date: Mon, 2 Mar 2020 10:13:36 +0100 Subject: [PATCH] time: Enable time/time to print its output in UTF8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes i3 bar parsing errors when the output contains characters not in the US-ASCII encoding space like the ä in the German März (March). Perl will by default print in US-ASCII/Latin-1 encoding, where especially the latter can contain characters that are not valid in UTF8. If that happens, this will cause the entire parsing of the i3blocks output to fail in i3 bar and cause it to only show an error message. --- time/time | 1 + 1 file changed, 1 insertion(+) diff --git a/time/time b/time/time index 725fc689..e552a92a 100755 --- a/time/time +++ b/time/time @@ -55,6 +55,7 @@ if (!exists $display_map{$ENV{TZ}}) { } $tz_display = $display_map{$ENV{TZ}}; +binmode(STDOUT, ":utf8"); my $time = strftime($format, localtime()); if ($tz_display eq "") { print "$time\n";