Bugfix: interpret commandline parameters as utf-8

fixes #1293
next
Michael Stapelberg 2014-06-25 10:00:23 +02:00
parent 0179f124d5
commit ad7bf58822
1 changed files with 4 additions and 0 deletions

View File

@ -18,6 +18,7 @@ use Pod::Usage;
use AnyEvent::I3; use AnyEvent::I3;
use JSON::XS; use JSON::XS;
use List::Util qw(first); use List::Util qw(first);
use Encode qw(decode);
use v5.10; use v5.10;
use utf8; use utf8;
use open ':encoding(UTF-8)'; use open ':encoding(UTF-8)';
@ -48,6 +49,9 @@ unless (defined($workspace) ^ defined($output)) {
die "Only one of --workspace or --output can be specified"; die "Only one of --workspace or --output can be specified";
} }
$workspace = decode('utf-8', $workspace);
$output = decode('utf-8', $output);
my $i3 = i3(); my $i3 = i3();
if (!$i3->connect->recv) { if (!$i3->connect->recv) {
die "Could not connect to i3"; die "Could not connect to i3";