Subject: | binmode STDOUT change of discipline |
Date: | Sat, 8 Sep 2018 09:29:24 +0000 |
To: | "bug-Net-SFTP-Foreign [...] rt.cpan.org" <bug-Net-SFTP-Foreign [...] rt.cpan.org> |
From: | Kapl Roland <roland.kapl [...] oebfa.at> |
Dear Salvador!
I use changing the output discipline with <binmode STDOUT, ":encoding(CP850)";> at the beginning of my script to get decent output of special characters (german "Umlauts", like ä,ö,ü etc.).
Now, Net::SFTP::Foreign package seems to revert this to raw after calling
Net::SFTP::Foreign->new(
host => $param->{RemoteHost},
user => $param->{user},
port => ($param->{port} ? $param->{port} : '22'),
ssh_cmd => $plinkInstallationPath,
more => [ -i => $param->{privKey}, "-v"]
);
I can work around this by setting binmode STDOUT, ":encoding(CP850)"; right after this call, however, I think this should be handled by Net::SFTP::Foreign.
I suspect this to happen in Net::SFTP::Foreign::Backend::Windows, in
sub _init_transport_streams {
my ($backend, $sftp) = @_;
binmode $sftp->{ssh_in};
binmode $sftp->{ssh_out};
}
-regards,
Roland