diff options
Diffstat (limited to 'rhimport.pm')
-rw-r--r-- | rhimport.pm | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/rhimport.pm b/rhimport.pm index 1c7efb4..8cd609d 100644 --- a/rhimport.pm +++ b/rhimport.pm @@ -168,6 +168,7 @@ sub import_playlist print "Starting import from playlist $playlist to $dropbox"; my @entries; open (FILE, $playlist) or die "can't open playlist $playlist: $!"; + binmode(FILE, ":utf8"); while (my $entry = <FILE>) { next if($entry =~ /^#/); next if($entry =~ /^\s/); @@ -240,6 +241,9 @@ sub scp_put_file $writer->autoflush(1); local $SIG{CHLD} = 'DEFAULT'; my $pid = open3($writer, $reader, $error, @cmd); + binmode($reader, ":utf8"); + binmode($writer, ":utf8"); + binmode($error, ":utf8"); waitpid $pid, 0; my $errstr = ""; if ( $? >> 8 ) { @@ -256,6 +260,9 @@ sub ssh_exec_command $writer->autoflush(1); local $SIG{CHLD} = 'DEFAULT'; my $pid = open3($writer, $reader, $error, @cmd); + binmode($reader, ":utf8"); + binmode($writer, ":utf8"); + binmode($error, ":utf8"); waitpid $pid, 0; my $out = join('', <$reader>); my $errstr = ""; |